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§
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 Methods§
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.