pub struct WebSocketMessageSender { /* private fields */ }Expand description
WebSocket message sender implementation for sending messages over WebSockets
This sender enables real-time bidirectional communication between TAP nodes, providing a persistent connection that can be used for both sending and receiving messages. WebSockets are particularly useful for scenarios requiring:
- Low-latency message delivery
- Bidirectional communication
- Connection state awareness
- Reduced overhead compared to repeated HTTP requests
§Connection Management
The WebSocket sender manages a pool of connections to recipient endpoints, keeping them alive and reconnecting as needed. This makes it suitable for high-frequency message exchanges between known parties.
§Error Handling
The sender handles various WebSocket-specific error conditions:
- Connection failures
- Message delivery failures
- Connection drops and reconnection
- Protocol errors
§Cross-platform Support
Like the HTTP sender, the WebSocket sender supports:
- Native environments (using tokio_tungstenite)
- WASM environments (using web-sys WebSocket API)
- Fallback implementations for environments without these libraries
Implementations§
Trait Implementations§
Source§impl Debug for WebSocketMessageSender
impl Debug for WebSocketMessageSender
Auto Trait Implementations§
impl Freeze for WebSocketMessageSender
impl RefUnwindSafe for WebSocketMessageSender
impl Send for WebSocketMessageSender
impl Sync for WebSocketMessageSender
impl Unpin for WebSocketMessageSender
impl UnwindSafe for WebSocketMessageSender
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