Trait barter_data::MarketStream

source ·
pub trait MarketStream<Exchange, Instrument, Kind>
where Self: Stream<Item = Result<MarketEvent<Instrument::Id, Kind::Event>, DataError>> + Send + Sized + Unpin, Exchange: Connector, Instrument: InstrumentData, Kind: SubscriptionKind,
{ // Required method fn init<'life0, 'async_trait>( subscriptions: &'life0 [Subscription<Exchange, Instrument, Kind>], ) -> Pin<Box<dyn Future<Output = Result<Self, DataError>> + Send + 'async_trait>> where Subscription<Exchange, Instrument, Kind>: Identifier<Exchange::Channel> + Identifier<Exchange::Market>, Self: 'async_trait, 'life0: 'async_trait; }
Expand description

Stream that yields Market<Kind> events. The type of Market<Kind> depends on the provided SubscriptionKind of the passed Subscriptions.

Required Methods§

source

fn init<'life0, 'async_trait>( subscriptions: &'life0 [Subscription<Exchange, Instrument, Kind>], ) -> Pin<Box<dyn Future<Output = Result<Self, DataError>> + Send + 'async_trait>>
where Subscription<Exchange, Instrument, Kind>: Identifier<Exchange::Channel> + Identifier<Exchange::Market>, Self: 'async_trait, 'life0: 'async_trait,

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Exchange, Instrument, Kind, Transformer> MarketStream<Exchange, Instrument, Kind> for ExchangeWsStream<Transformer>
where Exchange: Connector + Send + Sync, Instrument: InstrumentData, Kind: SubscriptionKind + Send + Sync, Transformer: ExchangeTransformer<Exchange, Instrument::Id, Kind> + Send, Kind::Event: Send,