pub struct WebSocket<const SIDE: bool, Stream> {
pub stream: Stream,
pub max_payload_len: usize,
/* private fields */
}
Expand description
WebSocket implementation for both client and server
it is a low-level abstraction that represents the underlying byte stream over which WebSocket messages are exchanged.
Maximum allowed payload length in bytes.
Default: 16 MB
Create a new websocket client instance.
Create a websocket server instance.
Send message to a endpoint.
Flushes this output stream, ensuring that all intermediately buffered contents reach their destination.
- The Close frame MAY contain a body that indicates a reason for closing.
reads Event from websocket stream.
Formats the value using the given formatter.
Read more
Converts to this type from the input type.
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Converts to this type from the input type.
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.