MarketStream

Trait MarketStream 

Source
pub trait MarketStream:
    Stream<Item = Result<StreamMessage>>
    + Send
    + Sync {
    // Required methods
    fn subscribe(&mut self, subscription: Subscription) -> Result<()>;
    fn unsubscribe(&mut self, token_ids: &[String]) -> Result<()>;
    fn is_connected(&self) -> bool;
    fn get_stats(&self) -> StreamStats;
}
Expand description

Trait for market data streams

Required Methods§

Source

fn subscribe(&mut self, subscription: Subscription) -> Result<()>

Subscribe to market data for specific tokens

Source

fn unsubscribe(&mut self, token_ids: &[String]) -> Result<()>

Unsubscribe from market data

Source

fn is_connected(&self) -> bool

Check if the stream is connected

Source

fn get_stats(&self) -> StreamStats

Get connection statistics

Implementors§