pub struct HybridConnection<H: ExchangeHandler> {
pub ws_client: WebSocketClient,
pub handler: H,
/* private fields */
}Expand description
Unified connection managing both REST and WebSocket
Fields§
§ws_client: WebSocketClientWebSocket client for real-time data
handler: HMessage handler for WebSocket
Implementations§
Source§impl<H: ExchangeHandler> HybridConnection<H>
impl<H: ExchangeHandler> HybridConnection<H>
Sourcepub fn new(ws_client: WebSocketClient, handler: H) -> Self
pub fn new(ws_client: WebSocketClient, handler: H) -> Self
Create a new hybrid connection
Sourcepub async fn start(&mut self) -> Result<()>
pub async fn start(&mut self) -> Result<()>
Start the connection (connect WebSocket and begin message processing)
Sourcepub fn connection_state(&self) -> ConnectionState
pub fn connection_state(&self) -> ConnectionState
Get current connection state
Sourcepub fn stats(&self) -> ConnectionStats
pub fn stats(&self) -> ConnectionStats
Get connection statistics
Auto Trait Implementations§
impl<H> !Freeze for HybridConnection<H>
impl<H> !RefUnwindSafe for HybridConnection<H>
impl<H> Send for HybridConnection<H>
impl<H> Sync for HybridConnection<H>
impl<H> Unpin for HybridConnection<H>where
H: Unpin,
impl<H> !UnwindSafe for HybridConnection<H>
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