pub struct MarketClient { /* private fields */ }
Implementations§
Source§impl MarketClient
impl MarketClient
pub fn new( host: String, login: String, password: String, sender_comp_id: String, heartbeat_interval: Option<u32>, ) -> Self
pub fn register_market_handler_arc<T: MarketDataHandler + Send + Sync + 'static>( &mut self, handler: Arc<T>, )
pub fn register_market_handler<T: MarketDataHandler + Send + Sync + 'static>( &mut self, handler: T, )
pub fn register_connection_handler_arc<T: ConnectionHandler + Send + Sync + 'static>( &mut self, handler: Arc<T>, )
pub fn register_connection_handler<T: ConnectionHandler + Send + Sync + 'static>( &mut self, handler: T, )
Sourcepub async fn connect(&mut self) -> Result<(), Error>
pub async fn connect(&mut self) -> Result<(), Error>
Connects to a server
This method first attempt to establish a connection. If the connection is succesful, then it proceeds to logon directly.
pub async fn disconnect(&mut self) -> Result<(), Error>
pub fn is_connected(&self) -> bool
pub async fn spot_subscription_list(&self) -> HashSet<u32>
pub async fn depth_subscription_list(&self) -> HashSet<u32>
pub async fn price_of(&self, symbol_id: u32) -> Result<SpotPrice, Error>
pub async fn depth_data( &self, symbol_id: u32, ) -> Result<HashMap<String, DepthPrice>, Error>
pub async fn subscribe_spot(&self, symbol_id: u32) -> Result<(), Error>
pub async fn unsubscribe_spot(&self, symbol_id: u32) -> Result<(), Error>
pub async fn subscribe_depth(&self, symbol_id: u32) -> Result<(), Error>
pub async fn unsubscribe_depth(&self, symbol_id: u32) -> Result<(), Error>
Auto Trait Implementations§
impl Freeze for MarketClient
impl !RefUnwindSafe for MarketClient
impl Send for MarketClient
impl Sync for MarketClient
impl Unpin for MarketClient
impl !UnwindSafe for MarketClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more