Crate tungstenite
Lightweight, flexible WebSockets for Rust.
Modules
- buffer A buffer for reading data from the network.
- client Methods to connect to a WebSocket as a client.
- error Error handling.
- handshake WebSocket handshake control.
- http
- protocol Generic WebSocket message stream.
- stream Convenience wrapper for streams to switch between plain TCP and TLS at runtime.
- util Helper traits to ease non-blocking handling.
Structs
- Bytes
- ClientHandshake Client handshake role.
-
ClientRequestBuilder
Builder for a custom
IntoClientRequestwith options to add custom additional headers and sub protocols. - ServerHandshake Server handshake role.
- Utf8Bytes Utf8 payload.
- WebSocket WebSocket input-output stream.
Enums
- Error Possible WebSocket errors.
- HandshakeError A handshake result.
- Message An enum representing the various forms of a WebSocket message.
Functions
- accept Accept the given Stream as a WebSocket.
- accept_hdr Accept the given Stream as a WebSocket.
- accept_hdr_with_config Accept the given Stream as a WebSocket.
- accept_with_config Accept the given Stream as a WebSocket.
- client Do the client handshake over the given stream.
- connect Connect to the given WebSocket in blocking mode.
Type Aliases
- Result Result type of all Tungstenite library calls.