Struct InputSessions
pub struct InputSessions(/* private fields */);Expand description
Controls which trading sessions are accepted as input bars.
Implementations§
§impl InputSessions
impl InputSessions
pub const REGULAR: InputSessions
pub const REGULAR: InputSessions
Include regular trading session bars.
pub const EXTENDED: InputSessions
pub const EXTENDED: InputSessions
Include extended-hours bars (pre-market and after-hours).
pub const OVERNIGHT: InputSessions
pub const OVERNIGHT: InputSessions
Include overnight session bars.
pub const ALL: InputSessions
pub const ALL: InputSessions
Include all supported sessions.
§impl InputSessions
impl InputSessions
pub const fn empty() -> InputSessions
pub const fn empty() -> InputSessions
Get a flags value with all bits unset.
pub const fn all() -> InputSessions
pub const fn all() -> InputSessions
Get a flags value with all known bits set.
pub const fn bits(&self) -> u8
pub const fn bits(&self) -> u8
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
pub const fn from_bits(bits: u8) -> Option<InputSessions>
pub const fn from_bits(bits: u8) -> Option<InputSessions>
Convert from a bits value.
This method will return None if any unknown bits are set.
pub const fn from_bits_truncate(bits: u8) -> InputSessions
pub const fn from_bits_truncate(bits: u8) -> InputSessions
Convert from a bits value, unsetting any unknown bits.
pub const fn from_bits_retain(bits: u8) -> InputSessions
pub const fn from_bits_retain(bits: u8) -> InputSessions
Convert from a bits value exactly.
pub fn from_name(name: &str) -> Option<InputSessions>
pub fn from_name(name: &str) -> Option<InputSessions>
Get a flags value with the bits of a flag with the given name set.
This method will return None if name is empty or doesn’t
correspond to any named flag.
pub const fn intersects(&self, other: InputSessions) -> bool
pub const fn intersects(&self, other: InputSessions) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
pub const fn contains(&self, other: InputSessions) -> bool
pub const fn contains(&self, other: InputSessions) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
pub fn insert(&mut self, other: InputSessions)
pub fn insert(&mut self, other: InputSessions)
The bitwise or (|) of the bits in two flags values.
pub fn remove(&mut self, other: InputSessions)
pub fn remove(&mut self, other: InputSessions)
The intersection of a source flags value with the complement of a target flags
value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
remove won’t truncate other, but the ! operator will.
pub fn toggle(&mut self, other: InputSessions)
pub fn toggle(&mut self, other: InputSessions)
The bitwise exclusive-or (^) of the bits in two flags values.
pub fn set(&mut self, other: InputSessions, value: bool)
pub fn set(&mut self, other: InputSessions, value: bool)
Call insert when value is true or remove when value is false.
pub const fn intersection(self, other: InputSessions) -> InputSessions
pub const fn intersection(self, other: InputSessions) -> InputSessions
The bitwise and (&) of the bits in two flags values.
pub const fn union(self, other: InputSessions) -> InputSessions
pub const fn union(self, other: InputSessions) -> InputSessions
The bitwise or (|) of the bits in two flags values.
pub const fn difference(self, other: InputSessions) -> InputSessions
pub const fn difference(self, other: InputSessions) -> InputSessions
The intersection of a source flags value with the complement of a target flags
value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
pub const fn symmetric_difference(self, other: InputSessions) -> InputSessions
pub const fn symmetric_difference(self, other: InputSessions) -> InputSessions
The bitwise exclusive-or (^) of the bits in two flags values.
pub const fn complement(self) -> InputSessions
pub const fn complement(self) -> InputSessions
The bitwise negation (!) of the bits in a flags value, truncating the result.
§impl InputSessions
impl InputSessions
pub const fn iter(&self) -> Iter<InputSessions>
pub const fn iter(&self) -> Iter<InputSessions>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
pub const fn iter_names(&self) -> IterNames<InputSessions>
pub const fn iter_names(&self) -> IterNames<InputSessions>
Yield a set of contained named flags values.
This method is like iter, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
§impl InputSessions
impl InputSessions
pub fn allow(self, trade_session: TradeSession) -> bool
pub fn allow(self, trade_session: TradeSession) -> bool
Returns whether a bar with the given TradeSession should be
processed.
Trait Implementations§
§impl Binary for InputSessions
impl Binary for InputSessions
§impl BitAnd for InputSessions
impl BitAnd for InputSessions
§fn bitand(self, other: InputSessions) -> InputSessions
fn bitand(self, other: InputSessions) -> InputSessions
The bitwise and (&) of the bits in two flags values.
§type Output = InputSessions
type Output = InputSessions
& operator.§impl BitAndAssign for InputSessions
impl BitAndAssign for InputSessions
§fn bitand_assign(&mut self, other: InputSessions)
fn bitand_assign(&mut self, other: InputSessions)
The bitwise and (&) of the bits in two flags values.
§impl BitOr for InputSessions
impl BitOr for InputSessions
§fn bitor(self, other: InputSessions) -> InputSessions
fn bitor(self, other: InputSessions) -> InputSessions
The bitwise or (|) of the bits in two flags values.
§type Output = InputSessions
type Output = InputSessions
| operator.§impl BitOrAssign for InputSessions
impl BitOrAssign for InputSessions
§fn bitor_assign(&mut self, other: InputSessions)
fn bitor_assign(&mut self, other: InputSessions)
The bitwise or (|) of the bits in two flags values.
§impl BitXor for InputSessions
impl BitXor for InputSessions
§fn bitxor(self, other: InputSessions) -> InputSessions
fn bitxor(self, other: InputSessions) -> InputSessions
The bitwise exclusive-or (^) of the bits in two flags values.
§type Output = InputSessions
type Output = InputSessions
^ operator.§impl BitXorAssign for InputSessions
impl BitXorAssign for InputSessions
§fn bitxor_assign(&mut self, other: InputSessions)
fn bitxor_assign(&mut self, other: InputSessions)
The bitwise exclusive-or (^) of the bits in two flags values.
§impl Clone for InputSessions
impl Clone for InputSessions
§fn clone(&self) -> InputSessions
fn clone(&self) -> InputSessions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for InputSessions
impl Debug for InputSessions
§impl<'de> Deserialize<'de> for InputSessions
impl<'de> Deserialize<'de> for InputSessions
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<InputSessions, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<InputSessions, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Extend<InputSessions> for InputSessions
impl Extend<InputSessions> for InputSessions
§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = InputSessions>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = InputSessions>,
The bitwise or (|) of the bits in each flags value.
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)§impl Flags for InputSessions
impl Flags for InputSessions
§const FLAGS: &'static [Flag<InputSessions>]
const FLAGS: &'static [Flag<InputSessions>]
§fn from_bits_retain(bits: u8) -> InputSessions
fn from_bits_retain(bits: u8) -> InputSessions
§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true if any unknown bits are set.§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
§fn iter_defined_names() -> IterDefinedNames<Self>
fn iter_defined_names() -> IterDefinedNames<Self>
Self::FLAGS].§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|) of the bits in two flags values.§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!). Read more§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^) of the bits in two flags values.§fn set(&mut self, other: Self, value: bool)where
Self: Sized,
fn set(&mut self, other: Self, value: bool)where
Self: Sized,
Flags::insert] when value is true or [Flags::remove] when value is false.§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&) of the bits in two flags values.§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!). Read more§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^) of the bits in two flags values.§fn complement(self) -> Self
fn complement(self) -> Self
!) of the bits in a flags value, truncating the result.§impl FromIterator<InputSessions> for InputSessions
impl FromIterator<InputSessions> for InputSessions
§fn from_iter<T>(iterator: T) -> InputSessionswhere
T: IntoIterator<Item = InputSessions>,
fn from_iter<T>(iterator: T) -> InputSessionswhere
T: IntoIterator<Item = InputSessions>,
The bitwise or (|) of the bits in each flags value.
§impl IntoIterator for InputSessions
impl IntoIterator for InputSessions
§type Item = InputSessions
type Item = InputSessions
§type IntoIter = Iter<InputSessions>
type IntoIter = Iter<InputSessions>
§fn into_iter(self) -> <InputSessions as IntoIterator>::IntoIter
fn into_iter(self) -> <InputSessions as IntoIterator>::IntoIter
§impl LowerHex for InputSessions
impl LowerHex for InputSessions
§impl Not for InputSessions
impl Not for InputSessions
§fn not(self) -> InputSessions
fn not(self) -> InputSessions
The bitwise negation (!) of the bits in a flags value, truncating the result.
§type Output = InputSessions
type Output = InputSessions
! operator.§impl Octal for InputSessions
impl Octal for InputSessions
§impl PartialEq for InputSessions
impl PartialEq for InputSessions
§impl Serialize for InputSessions
impl Serialize for InputSessions
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
§impl Sub for InputSessions
impl Sub for InputSessions
§fn sub(self, other: InputSessions) -> InputSessions
fn sub(self, other: InputSessions) -> InputSessions
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
§type Output = InputSessions
type Output = InputSessions
- operator.§impl SubAssign for InputSessions
impl SubAssign for InputSessions
§fn sub_assign(&mut self, other: InputSessions)
fn sub_assign(&mut self, other: InputSessions)
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
§impl UpperHex for InputSessions
impl UpperHex for InputSessions
impl Copy for InputSessions
impl Eq for InputSessions
impl StructuralPartialEq for InputSessions
Auto Trait Implementations§
impl Freeze for InputSessions
impl RefUnwindSafe for InputSessions
impl Send for InputSessions
impl Sync for InputSessions
impl Unpin for InputSessions
impl UnsafeUnpin for InputSessions
impl UnwindSafe for InputSessions
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.