pub trait ExchangeTransformer<Exchange, InstrumentKey, Kind>where
Self: Transformer<Output = MarketEvent<InstrumentKey, Kind::Event>, Error = DataError> + Sized,
Kind: SubscriptionKind,{
// Required method
fn init(
instrument_map: Map<InstrumentKey>,
initial_snapshots: &[MarketEvent<InstrumentKey, Kind::Event>],
ws_sink_tx: UnboundedSender<WsMessage>,
) -> impl Future<Output = Result<Self, DataError>> + Send
where InstrumentKey: Sync,
Kind::Event: Sync;
}Expand description
Defines how to construct a Transformer used by MarketStreams to
translate exchange specific types to normalised Barter types.
Required Methods§
Sourcefn init(
instrument_map: Map<InstrumentKey>,
initial_snapshots: &[MarketEvent<InstrumentKey, Kind::Event>],
ws_sink_tx: UnboundedSender<WsMessage>,
) -> impl Future<Output = Result<Self, DataError>> + Send
fn init( instrument_map: Map<InstrumentKey>, initial_snapshots: &[MarketEvent<InstrumentKey, Kind::Event>], ws_sink_tx: UnboundedSender<WsMessage>, ) -> impl Future<Output = Result<Self, DataError>> + Send
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.