pub trait RestProvider:
Send
+ Sync
+ Debug {
// Required methods
fn name(&self) -> &'static str;
fn venue(&self) -> Venue;
fn config(&self) -> &ConnectionConfig;
fn http_client(&self) -> &Client;
fn init<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_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 get_historical_trades<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
limit: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<MarketTrade>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_orderbook_snapshot<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
depth: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<OrderBookSnapshot>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_rate_limits(&self) -> Vec<RateLimit>;
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
REST API provider for exchange metadata and historical data This trait focuses purely on HTTP-based operations
Required Methods§
Sourcefn config(&self) -> &ConnectionConfig
fn config(&self) -> &ConnectionConfig
Returns reference to the connection configuration
Sourcefn http_client(&self) -> &Client
fn http_client(&self) -> &Client
Returns reference to the HTTP client
Sourcefn init<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn init<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Initialize the provider with any necessary setup steps
Sourcefn get_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 get_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,
Get all available trading instruments from the exchange
Sourcefn get_historical_trades<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
limit: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<MarketTrade>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_historical_trades<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
limit: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<MarketTrade>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get historical trades for a symbol
Sourcefn get_orderbook_snapshot<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
depth: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<OrderBookSnapshot>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_orderbook_snapshot<'life0, 'life1, 'async_trait>(
&'life0 self,
symbol: &'life1 str,
depth: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<OrderBookSnapshot>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get current orderbook snapshot for a symbol
Sourcefn get_rate_limits(&self) -> Vec<RateLimit>
fn get_rate_limits(&self) -> Vec<RateLimit>
Get the exchange-specific rate limits