pub trait ProviderExt {
// Required methods
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe_orderbook<'life0, 'life1, 'async_trait>(
&'life0 mut self,
instrument_id: &'life1 InstrumentId,
depth: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn subscribe_trades<'life0, 'life1, 'async_trait>(
&'life0 mut self,
instrument_id: &'life1 InstrumentId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn unsubscribe_orderbook<'life0, 'life1, 'async_trait>(
&'life0 mut self,
instrument_id: &'life1 InstrumentId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn unsubscribe_trades<'life0, 'life1, 'async_trait>(
&'life0 mut self,
instrument_id: &'life1 InstrumentId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn is_connected(&self) -> bool;
fn connection_stats(&self) -> ConnectionStats;
fn run_with_handler<'life0, 'async_trait>(
&'life0 mut self,
handler: Box<dyn DataHandler + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn fetch_instruments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Box<dyn Instrument>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Extension trait for new provider implementations
Required Methods§
Sourcefn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connect to the exchange
Sourcefn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Disconnect from the exchange
Sourcefn subscribe_orderbook<'life0, 'life1, 'async_trait>(
&'life0 mut self,
instrument_id: &'life1 InstrumentId,
depth: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn subscribe_orderbook<'life0, 'life1, 'async_trait>(
&'life0 mut self,
instrument_id: &'life1 InstrumentId,
depth: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Subscribe to orderbook updates for an instrument
Sourcefn subscribe_trades<'life0, 'life1, 'async_trait>(
&'life0 mut self,
instrument_id: &'life1 InstrumentId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn subscribe_trades<'life0, 'life1, 'async_trait>(
&'life0 mut self,
instrument_id: &'life1 InstrumentId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Subscribe to trade updates for an instrument
Sourcefn unsubscribe_orderbook<'life0, 'life1, 'async_trait>(
&'life0 mut self,
instrument_id: &'life1 InstrumentId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unsubscribe_orderbook<'life0, 'life1, 'async_trait>(
&'life0 mut self,
instrument_id: &'life1 InstrumentId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unsubscribe from orderbook updates
Sourcefn unsubscribe_trades<'life0, 'life1, 'async_trait>(
&'life0 mut self,
instrument_id: &'life1 InstrumentId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unsubscribe_trades<'life0, 'life1, 'async_trait>(
&'life0 mut self,
instrument_id: &'life1 InstrumentId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unsubscribe from trade updates
Sourcefn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Check if connected
Sourcefn connection_stats(&self) -> ConnectionStats
fn connection_stats(&self) -> ConnectionStats
Get connection statistics
Sourcefn run_with_handler<'life0, 'async_trait>(
&'life0 mut self,
handler: Box<dyn DataHandler + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run_with_handler<'life0, 'async_trait>(
&'life0 mut self,
handler: Box<dyn DataHandler + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Run the provider with a data handler
Sourcefn fetch_instruments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Box<dyn Instrument>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_instruments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Box<dyn Instrument>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch available instruments