pub struct BinanceWebSocketClient { /* private fields */ }Expand description
WebSocket client for Binance user data stream
Implementations§
Source§impl BinanceWebSocketClient
impl BinanceWebSocketClient
Sourcepub fn new(auth: Arc<BinanceAuth>) -> Self
pub fn new(auth: Arc<BinanceAuth>) -> Self
Create a new Binance WebSocket client with direct auth for maximum performance
Sourcepub fn with_api_url(self, api_url: &str) -> Self
pub fn with_api_url(self, api_url: &str) -> Self
Create a new Binance WebSocket client with custom API URL
Sourcepub async fn start_user_data_stream(
&self,
report_tx: Sender<ExecutionReport>,
market_type: Option<&str>,
) -> Result<()>
pub async fn start_user_data_stream( &self, report_tx: Sender<ExecutionReport>, market_type: Option<&str>, ) -> Result<()>
Start WebSocket connection for user data stream
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if WebSocket is connected
Sourcepub async fn disconnect(&self) -> Result<()>
pub async fn disconnect(&self) -> Result<()>
Disconnect WebSocket
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BinanceWebSocketClient
impl !RefUnwindSafe for BinanceWebSocketClient
impl Send for BinanceWebSocketClient
impl Sync for BinanceWebSocketClient
impl Unpin for BinanceWebSocketClient
impl !UnwindSafe for BinanceWebSocketClient
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