#[non_exhaustive]pub struct SessionOverride {
pub date: NaiveDate,
pub windows: Vec<OverrideWindow>,
pub extended_windows: Vec<OverrideWindow>,
}Expand description
The hours of one trading date, in place of its weekly windows and holiday.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.date: NaiveDateThe trading date, named by the day on which the windows close, as in
SessionWindow::days.
windows: Vec<OverrideWindow>Regular windows of the date; an early close is one window ending early.
extended_windows: Vec<OverrideWindow>Pre-market and post-market windows of the date.
Implementations§
Source§impl SessionOverride
impl SessionOverride
Sourcepub fn new(date: NaiveDate) -> Self
pub fn new(date: NaiveDate) -> Self
A closure: every window of date is closed. Add hours with
with_windows and
with_extended_windows.
Sourcepub fn with_windows(
self,
windows: impl IntoIterator<Item = OverrideWindow>,
) -> Self
pub fn with_windows( self, windows: impl IntoIterator<Item = OverrideWindow>, ) -> Self
Sets the regular windows of the date.
Sourcepub fn with_extended_windows(
self,
windows: impl IntoIterator<Item = OverrideWindow>,
) -> Self
pub fn with_extended_windows( self, windows: impl IntoIterator<Item = OverrideWindow>, ) -> Self
Sets the extended windows of the date.
Trait Implementations§
Source§impl Clone for SessionOverride
impl Clone for SessionOverride
Source§fn clone(&self) -> SessionOverride
fn clone(&self) -> SessionOverride
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SessionOverride
impl Debug for SessionOverride
Source§impl<'de> Deserialize<'de> for SessionOverride
impl<'de> Deserialize<'de> for SessionOverride
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SessionOverride
Source§impl Hash for SessionOverride
impl Hash for SessionOverride
Source§impl PartialEq for SessionOverride
impl PartialEq for SessionOverride
Source§impl Serialize for SessionOverride
impl Serialize for SessionOverride
impl StructuralPartialEq for SessionOverride
Auto Trait Implementations§
impl Freeze for SessionOverride
impl RefUnwindSafe for SessionOverride
impl Send for SessionOverride
impl Sync for SessionOverride
impl Unpin for SessionOverride
impl UnsafeUnpin for SessionOverride
impl UnwindSafe for SessionOverride
Blanket Implementations§
impl<T> AsId for T
impl<T> AsIdSalt for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more