Skip to main content

OrderBookWebSocket

Trait OrderBookWebSocket 

Source
pub trait OrderBookWebSocket: Send + Sync {
    // Required methods
    async fn connect(&mut self) -> Result<(), WebSocketError>;
    async fn disconnect(&mut self) -> Result<(), WebSocketError>;
    async fn subscribe(&mut self, market_id: &str) -> Result<(), WebSocketError>;
    async fn unsubscribe(
        &mut self,
        market_id: &str,
    ) -> Result<(), WebSocketError>;
    fn state(&self) -> WebSocketState;
    async fn orderbook_stream(
        &mut self,
        market_id: &str,
    ) -> Result<OrderbookStream, WebSocketError>;

    // Provided method
    async fn activity_stream(
        &mut self,
        _market_id: &str,
    ) -> Result<ActivityStream, WebSocketError> { ... }
}

Required Methods§

Source

async fn connect(&mut self) -> Result<(), WebSocketError>

Source

async fn disconnect(&mut self) -> Result<(), WebSocketError>

Source

async fn subscribe(&mut self, market_id: &str) -> Result<(), WebSocketError>

Source

async fn unsubscribe(&mut self, market_id: &str) -> Result<(), WebSocketError>

Source

fn state(&self) -> WebSocketState

Source

async fn orderbook_stream( &mut self, market_id: &str, ) -> Result<OrderbookStream, WebSocketError>

Provided Methods§

Source

async fn activity_stream( &mut self, _market_id: &str, ) -> Result<ActivityStream, WebSocketError>

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.

Implementors§