pub struct TradeConditions(/* private fields */);Expand description
Sale conditions of a trade, as a set of flags. Combine them with | and test them with
intersects:
use egui_charts::model::{Tick, TradeConditions};
let trade = Tick::new(chrono::Utc::now(), 100.0, 5.0, None)
.with_conditions(TradeConditions::AUCTION);
let leave_out = TradeConditions::OFF_EXCHANGE | TradeConditions::AUCTION;
assert!(trade.conditions.intersects(leave_out));Implementations§
Source§impl TradeConditions
impl TradeConditions
Sourcepub const OFF_EXCHANGE: Self
pub const OFF_EXCHANGE: Self
Reported away from the exchange’s book, such as by a dark pool or an over-the-counter dealer.
Sourcepub const AUCTION: Self
pub const AUCTION: Self
Printed by an opening, closing or reopening auction rather than by continuous trading.
Sourcepub const OUT_OF_SEQUENCE: Self
pub const OUT_OF_SEQUENCE: Self
Reported late or out of sequence, after trades executed later than it.
Sourcepub const EXTENDED_HOURS: Self
pub const EXTENDED_HOURS: Self
Executed outside the regular trading session.
Sourcepub fn intersects(self, other: Self) -> bool
pub fn intersects(self, other: Self) -> bool
Whether any condition of other is set.
Trait Implementations§
Source§impl BitOr for TradeConditions
impl BitOr for TradeConditions
Source§impl Clone for TradeConditions
impl Clone for TradeConditions
Source§fn clone(&self) -> TradeConditions
fn clone(&self) -> TradeConditions
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 moreimpl Copy for TradeConditions
Source§impl Debug for TradeConditions
impl Debug for TradeConditions
Source§impl Default for TradeConditions
impl Default for TradeConditions
Source§fn default() -> TradeConditions
fn default() -> TradeConditions
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TradeConditions
impl<'de> Deserialize<'de> for TradeConditions
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 TradeConditions
Source§impl Hash for TradeConditions
impl Hash for TradeConditions
Source§impl PartialEq for TradeConditions
impl PartialEq for TradeConditions
Source§impl Serialize for TradeConditions
impl Serialize for TradeConditions
impl StructuralPartialEq for TradeConditions
Auto Trait Implementations§
impl Freeze for TradeConditions
impl RefUnwindSafe for TradeConditions
impl Send for TradeConditions
impl Sync for TradeConditions
impl Unpin for TradeConditions
impl UnsafeUnpin for TradeConditions
impl UnwindSafe for TradeConditions
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