pub struct WebSocketPlainMessageSender { /* 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
- PlainMessage 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 WebSocketPlainMessageSender
impl Debug for WebSocketPlainMessageSender
Auto Trait Implementations§
impl Freeze for WebSocketPlainMessageSender
impl RefUnwindSafe for WebSocketPlainMessageSender
impl Send for WebSocketPlainMessageSender
impl Sync for WebSocketPlainMessageSender
impl Unpin for WebSocketPlainMessageSender
impl UnwindSafe for WebSocketPlainMessageSender
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more