Trait RestProvider

Source
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§

Source

fn name(&self) -> &'static str

Returns the exchange name as a static string

Source

fn venue(&self) -> Venue

Returns the venue enum value for this provider

Source

fn config(&self) -> &ConnectionConfig

Returns reference to the connection configuration

Source

fn http_client(&self) -> &Client

Returns reference to the HTTP client

Source

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

Source

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

Source

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

Source

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

Source

fn get_rate_limits(&self) -> Vec<RateLimit>

Get the exchange-specific rate limits

Source

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,

Check provider health via REST API

Implementors§