Struct barter_data::event::MarketEvent
source · pub struct MarketEvent<InstrumentId, T> {
pub exchange_time: DateTime<Utc>,
pub received_time: DateTime<Utc>,
pub exchange: Exchange,
pub instrument: InstrumentId,
pub kind: T,
}Expand description
Normalised Barter MarketEvent<T> wrapping the T data variant in metadata.
Note: T can be an enum such as the DataKind if required.
See crate::subscription for all existing Barter Market event variants.
§Examples
Fields§
§exchange_time: DateTime<Utc>§received_time: DateTime<Utc>§exchange: Exchange§instrument: InstrumentId§kind: TTrait Implementations§
source§impl<InstrumentId: Clone, T: Clone> Clone for MarketEvent<InstrumentId, T>
impl<InstrumentId: Clone, T: Clone> Clone for MarketEvent<InstrumentId, T>
source§fn clone(&self) -> MarketEvent<InstrumentId, T>
fn clone(&self) -> MarketEvent<InstrumentId, T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<'de, InstrumentId, T> Deserialize<'de> for MarketEvent<InstrumentId, T>where
InstrumentId: Deserialize<'de>,
T: Deserialize<'de>,
impl<'de, InstrumentId, T> Deserialize<'de> for MarketEvent<InstrumentId, T>where
InstrumentId: Deserialize<'de>,
T: Deserialize<'de>,
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
source§impl<InstrumentId> From<MarketEvent<InstrumentId, Candle>> for MarketEvent<InstrumentId, DataKind>
impl<InstrumentId> From<MarketEvent<InstrumentId, Candle>> for MarketEvent<InstrumentId, DataKind>
source§fn from(event: MarketEvent<InstrumentId, Candle>) -> Self
fn from(event: MarketEvent<InstrumentId, Candle>) -> Self
Converts to this type from the input type.
source§impl<InstrumentId> From<MarketEvent<InstrumentId, Liquidation>> for MarketEvent<InstrumentId, DataKind>
impl<InstrumentId> From<MarketEvent<InstrumentId, Liquidation>> for MarketEvent<InstrumentId, DataKind>
source§fn from(event: MarketEvent<InstrumentId, Liquidation>) -> Self
fn from(event: MarketEvent<InstrumentId, Liquidation>) -> Self
Converts to this type from the input type.
source§impl<InstrumentId> From<MarketEvent<InstrumentId, OrderBook>> for MarketEvent<InstrumentId, DataKind>
impl<InstrumentId> From<MarketEvent<InstrumentId, OrderBook>> for MarketEvent<InstrumentId, DataKind>
source§fn from(event: MarketEvent<InstrumentId, OrderBook>) -> Self
fn from(event: MarketEvent<InstrumentId, OrderBook>) -> Self
Converts to this type from the input type.
source§impl<InstrumentId> From<MarketEvent<InstrumentId, OrderBookL1>> for MarketEvent<InstrumentId, DataKind>
impl<InstrumentId> From<MarketEvent<InstrumentId, OrderBookL1>> for MarketEvent<InstrumentId, DataKind>
source§fn from(event: MarketEvent<InstrumentId, OrderBookL1>) -> Self
fn from(event: MarketEvent<InstrumentId, OrderBookL1>) -> Self
Converts to this type from the input type.
source§impl<InstrumentId> From<MarketEvent<InstrumentId, PublicTrade>> for MarketEvent<InstrumentId, DataKind>
impl<InstrumentId> From<MarketEvent<InstrumentId, PublicTrade>> for MarketEvent<InstrumentId, DataKind>
source§fn from(event: MarketEvent<InstrumentId, PublicTrade>) -> Self
fn from(event: MarketEvent<InstrumentId, PublicTrade>) -> Self
Converts to this type from the input type.
source§impl<InstrumentId: Ord, T: Ord> Ord for MarketEvent<InstrumentId, T>
impl<InstrumentId: Ord, T: Ord> Ord for MarketEvent<InstrumentId, T>
source§fn cmp(&self, other: &MarketEvent<InstrumentId, T>) -> Ordering
fn cmp(&self, other: &MarketEvent<InstrumentId, T>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<InstrumentId: PartialEq, T: PartialEq> PartialEq for MarketEvent<InstrumentId, T>
impl<InstrumentId: PartialEq, T: PartialEq> PartialEq for MarketEvent<InstrumentId, T>
source§fn eq(&self, other: &MarketEvent<InstrumentId, T>) -> bool
fn eq(&self, other: &MarketEvent<InstrumentId, T>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<InstrumentId: PartialOrd, T: PartialOrd> PartialOrd for MarketEvent<InstrumentId, T>
impl<InstrumentId: PartialOrd, T: PartialOrd> PartialOrd for MarketEvent<InstrumentId, T>
source§fn partial_cmp(&self, other: &MarketEvent<InstrumentId, T>) -> Option<Ordering>
fn partial_cmp(&self, other: &MarketEvent<InstrumentId, T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl<InstrumentId, T> Serialize for MarketEvent<InstrumentId, T>
impl<InstrumentId, T> Serialize for MarketEvent<InstrumentId, T>
impl<InstrumentId: Eq, T: Eq> Eq for MarketEvent<InstrumentId, T>
impl<InstrumentId, T> StructuralPartialEq for MarketEvent<InstrumentId, T>
Auto Trait Implementations§
impl<InstrumentId, T> Freeze for MarketEvent<InstrumentId, T>
impl<InstrumentId, T> RefUnwindSafe for MarketEvent<InstrumentId, T>where
InstrumentId: RefUnwindSafe,
T: RefUnwindSafe,
impl<InstrumentId, T> Send for MarketEvent<InstrumentId, T>
impl<InstrumentId, T> Sync for MarketEvent<InstrumentId, T>
impl<InstrumentId, T> Unpin for MarketEvent<InstrumentId, T>
impl<InstrumentId, T> UnwindSafe for MarketEvent<InstrumentId, T>where
InstrumentId: UnwindSafe,
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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