Struct barter_data::transformer::book::MultiBookTransformer
source · pub struct MultiBookTransformer<Exchange, InstrumentId, Kind, Updater> {
pub book_map: Map<InstrumentOrderBook<InstrumentId, Updater>>,
/* private fields */
}Expand description
Standard generic ExchangeTransformer to translate exchange specific OrderBook types into
normalised Barter OrderBook types. Requires an exchange specific OrderBookUpdater
implementation.
Fields§
§book_map: Map<InstrumentOrderBook<InstrumentId, Updater>>Trait Implementations§
source§impl<Exchange: Clone, InstrumentId: Clone, Kind: Clone, Updater: Clone> Clone for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
impl<Exchange: Clone, InstrumentId: Clone, Kind: Clone, Updater: Clone> Clone for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
source§fn clone(&self) -> MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
fn clone(&self) -> MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
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<Exchange: Debug, InstrumentId: Debug, Kind: Debug, Updater: Debug> Debug for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
impl<Exchange: Debug, InstrumentId: Debug, Kind: Debug, Updater: Debug> Debug for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
source§impl<'de, Exchange, InstrumentId, Kind, Updater> Deserialize<'de> for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>where
InstrumentId: Deserialize<'de>,
Updater: Deserialize<'de>,
impl<'de, Exchange, InstrumentId, Kind, Updater> Deserialize<'de> for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>where
InstrumentId: Deserialize<'de>,
Updater: 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<Exchange, Kind, Updater> ExchangeTransformer<Exchange, Instrument, Kind> for MultiBookTransformer<Exchange, Instrument, Kind, Updater>where
Exchange: Connector + Send,
Kind: SubscriptionKind<Event = OrderBook> + Send,
Updater: OrderBookUpdater<OrderBook = Kind::Event> + Send,
Updater::Update: Identifier<Option<SubscriptionId>> + for<'de> Deserialize<'de>,
impl<Exchange, Kind, Updater> ExchangeTransformer<Exchange, Instrument, Kind> for MultiBookTransformer<Exchange, Instrument, Kind, Updater>where
Exchange: Connector + Send,
Kind: SubscriptionKind<Event = OrderBook> + Send,
Updater: OrderBookUpdater<OrderBook = Kind::Event> + Send,
Updater::Update: Identifier<Option<SubscriptionId>> + for<'de> Deserialize<'de>,
source§impl<Exchange: PartialEq, InstrumentId: PartialEq, Kind: PartialEq, Updater: PartialEq> PartialEq for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
impl<Exchange: PartialEq, InstrumentId: PartialEq, Kind: PartialEq, Updater: PartialEq> PartialEq for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
source§fn eq(
&self,
other: &MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>,
) -> bool
fn eq( &self, other: &MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>, ) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<Exchange, InstrumentId, Kind, Updater> Serialize for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
impl<Exchange, InstrumentId, Kind, Updater> Serialize for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
source§impl<Exchange, InstrumentId, Kind, Updater> Transformer for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>where
Exchange: Connector,
InstrumentId: Clone,
Kind: SubscriptionKind<Event = OrderBook>,
Updater: OrderBookUpdater<OrderBook = Kind::Event>,
Updater::Update: Identifier<Option<SubscriptionId>> + for<'de> Deserialize<'de>,
impl<Exchange, InstrumentId, Kind, Updater> Transformer for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>where
Exchange: Connector,
InstrumentId: Clone,
Kind: SubscriptionKind<Event = OrderBook>,
Updater: OrderBookUpdater<OrderBook = Kind::Event>,
Updater::Update: Identifier<Option<SubscriptionId>> + for<'de> Deserialize<'de>,
type Error = DataError
type Input = <Updater as OrderBookUpdater>::Update
type Output = MarketEvent<InstrumentId, <Kind as SubscriptionKind>::Event>
type OutputIter = Vec<Result<<MultiBookTransformer<Exchange, InstrumentId, Kind, Updater> as Transformer>::Output, <MultiBookTransformer<Exchange, InstrumentId, Kind, Updater> as Transformer>::Error>>
fn transform(&mut self, update: Self::Input) -> Self::OutputIter
impl<Exchange: Eq, InstrumentId: Eq, Kind: Eq, Updater: Eq> Eq for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
impl<Exchange, InstrumentId, Kind, Updater> StructuralPartialEq for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
Auto Trait Implementations§
impl<Exchange, InstrumentId, Kind, Updater> Freeze for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
impl<Exchange, InstrumentId, Kind, Updater> RefUnwindSafe for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>where
Exchange: RefUnwindSafe,
Kind: RefUnwindSafe,
InstrumentId: RefUnwindSafe,
Updater: RefUnwindSafe,
impl<Exchange, InstrumentId, Kind, Updater> Send for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
impl<Exchange, InstrumentId, Kind, Updater> Sync for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
impl<Exchange, InstrumentId, Kind, Updater> Unpin for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
impl<Exchange, InstrumentId, Kind, Updater> UnwindSafe for MultiBookTransformer<Exchange, InstrumentId, Kind, Updater>
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> 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