Trait MarketDataHandler

Source
pub trait MarketDataHandler {
    // Required methods
    fn on_price_of<'life0, 'async_trait>(
        &'life0 self,
        symbol_id: u32,
        price: SpotPrice,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn on_market_depth_full_refresh<'life0, 'async_trait>(
        &'life0 self,
        symbol_id: u32,
        full_depth: HashMap<String, DepthPrice>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn on_market_depth_incremental_refresh<'life0, 'async_trait>(
        &'life0 self,
        refresh: Vec<IncrementalRefresh>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn on_accpeted_spot_subscription<'life0, 'async_trait>(
        &'life0 self,
        symbol_id: u32,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn on_accpeted_depth_subscription<'life0, 'async_trait>(
        &'life0 self,
        symbol_id: u32,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn on_rejected_spot_subscription<'life0, 'async_trait>(
        &'life0 self,
        symbol_id: u32,
        err_msg: String,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn on_rejected_depth_subscription<'life0, 'async_trait>(
        &'life0 self,
        symbol_id: u32,
        err_msg: String,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}

Required Methods§

Source

fn on_price_of<'life0, 'async_trait>( &'life0 self, symbol_id: u32, price: SpotPrice, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a new price for a symbol is received.

Source

fn on_market_depth_full_refresh<'life0, 'async_trait>( &'life0 self, symbol_id: u32, full_depth: HashMap<String, DepthPrice>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a full refresh of the market depth is received.

Source

fn on_market_depth_incremental_refresh<'life0, 'async_trait>( &'life0 self, refresh: Vec<IncrementalRefresh>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when an incremental update to the market depth is received.

Provided Methods§

Source

fn on_accpeted_spot_subscription<'life0, 'async_trait>( &'life0 self, symbol_id: u32, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Called when a spot subscription request has been accepted by the server. This function has a default empty implementation and can be overridden by the struct implementing this trait.

Source

fn on_accpeted_depth_subscription<'life0, 'async_trait>( &'life0 self, symbol_id: u32, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Called when a depth subscription request has been accepted by the server. This function has a default empty implementation and can be overridden by the struct implementing this trait.

Source

fn on_rejected_spot_subscription<'life0, 'async_trait>( &'life0 self, symbol_id: u32, err_msg: String, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Called when a spot subscription request has been rejected by the server. This function has a default empty implementation and can be overridden by the struct implementing this trait.

Source

fn on_rejected_depth_subscription<'life0, 'async_trait>( &'life0 self, symbol_id: u32, err_msg: String, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Called when a depth subscription request has been rejected by the server. This function has a default empty implementation and can be overridden by the struct implementing this trait.

Implementors§