pub struct BinanceConnectionManager { /* private fields */ }Expand description
Manages multiple WebSocket connections for Binance to handle sharding and isolation
Implementations§
Source§impl BinanceConnectionManager
impl BinanceConnectionManager
Sourcepub async fn get_public_connection(&self) -> Result<Arc<BinanceWs>>
pub async fn get_public_connection(&self) -> Result<Arc<BinanceWs>>
Gets or creates a public connection suitable for a new subscription
Sourcepub async fn get_private_connection(
&self,
binance: &Arc<Binance>,
) -> Result<Arc<BinanceWs>>
pub async fn get_private_connection( &self, binance: &Arc<Binance>, ) -> Result<Arc<BinanceWs>>
Gets or creates the dedicated private connection
Sourcepub async fn active_shards_count(&self) -> usize
pub async fn active_shards_count(&self) -> usize
Returns the number of active public shards
Sourcepub async fn disconnect_all(&self) -> Result<()>
pub async fn disconnect_all(&self) -> Result<()>
Disconnects all active connections
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Checks if any connection is active (non-blocking)
Sourcepub fn get_all_subscriptions(&self) -> Vec<String>
pub fn get_all_subscriptions(&self) -> Vec<String>
Returns a list of all active subscriptions across all connections
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BinanceConnectionManager
impl !RefUnwindSafe for BinanceConnectionManager
impl Send for BinanceConnectionManager
impl Sync for BinanceConnectionManager
impl Unpin for BinanceConnectionManager
impl !UnwindSafe for BinanceConnectionManager
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