pub trait SnapshotFetcher<Exchange, Kind> {
// Required method
fn fetch_snapshots<Instrument>(
subscriptions: &[Subscription<Exchange, Instrument, Kind>],
) -> impl Future<Output = Result<Vec<MarketEvent<Instrument::Key, Kind::Event>>, SocketError>> + Send
where Exchange: Connector,
Instrument: InstrumentData,
Kind: SubscriptionKind,
Kind::Event: Send,
Subscription<Exchange, Instrument, Kind>: Identifier<Exchange::Market>;
}Expand description
Defines how to fetch market data snapshots for a collection of Subscriptions.
Useful when a MarketStream requires an initial snapshot on start-up.
See examples such as Binance OrderBooksL2:
Required Methods§
fn fetch_snapshots<Instrument>(
subscriptions: &[Subscription<Exchange, Instrument, Kind>],
) -> impl Future<Output = Result<Vec<MarketEvent<Instrument::Key, Kind::Event>>, SocketError>> + Sendwhere
Exchange: Connector,
Instrument: InstrumentData,
Kind: SubscriptionKind,
Kind::Event: Send,
Subscription<Exchange, Instrument, Kind>: Identifier<Exchange::Market>,
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.