pub trait ExchangeTransformer<Exchange, InstrumentKey, Kind>where
Self: Transformer<Output = MarketEvent<InstrumentKey, Kind::Event>, Error = DataError> + Sized,
Kind: SubscriptionKind,{
// Required method
fn init<'life0, 'async_trait>(
instrument_map: Map<InstrumentKey>,
initial_snapshots: &'life0 [MarketEvent<InstrumentKey, Kind::Event>],
ws_sink_tx: UnboundedSender<WsMessage>,
) -> Pin<Box<dyn Future<Output = Result<Self, DataError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Defines how to construct a Transformer used by MarketStreams to
translate exchange specific types to normalised Barter types.
Required Methods§
Sourcefn init<'life0, 'async_trait>(
instrument_map: Map<InstrumentKey>,
initial_snapshots: &'life0 [MarketEvent<InstrumentKey, Kind::Event>],
ws_sink_tx: UnboundedSender<WsMessage>,
) -> Pin<Box<dyn Future<Output = Result<Self, DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn init<'life0, 'async_trait>(
instrument_map: Map<InstrumentKey>,
initial_snapshots: &'life0 [MarketEvent<InstrumentKey, Kind::Event>],
ws_sink_tx: UnboundedSender<WsMessage>,
) -> Pin<Box<dyn Future<Output = Result<Self, DataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Initialise a new Self, also fetching any market data snapshots required for the
associated Exchange and SubscriptionKind market stream to function.
The mpsc::UnboundedSender can be used by Self to send messages back to the exchange.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.