Expand description
async WebSocket server functionality (requires tokio executor)
Re-exports§
Modules§
- error
Error
enum declaration for server-side WebSocket errors.- handshake
- Module containing simple convenience handshake functions
such as
greeting()
- result
- Result module encapsulating
Result
enum used by theWebSocketServer
Structs§
- TcpListener
- A TCP socket server, listening for connections.
- WebSocket
Config - The configuration for WebSocket connection.
- WebSocket
Counters - Atomic counters that allow tracking connection counts
and cumulative message sizes in bytes (bandwidth consumption
without accounting for the websocket framing overhead).
These counters can be created and supplied externally or
supplied as
None
. - WebSocket
Server - WebSocketServer that provides the main websocket connection and message processing loop that delivers messages to the installed WebSocketHandler trait.
Enums§
- Message
- An enum representing the various forms of a WebSocket message.
Traits§
- WebSocket
Handler - WebSocketHandler trait that represents the WebSocket processor
functionality. This trait is supplied to the WebSocket
which subsequently invokes it’s functions during websocket
connection and messages. The trait can override
with_handshake()
method to enable invocation of thehandshake()
method upon receipt of the first valid websocket message from the incoming connection. - WebSocket
Server Trait - Base WebSocketServer trait allows the
WebSocketServer<T>
struct to be retained by the trait reference by casting it to the trait as follows:
Type Aliases§
- WebSocket
Receiver - WebSocket stream receiver for receiving
tungstenite::Message
. This stream object must have a mutable reference and can not be cloned. - WebSocket
Sender - WebSocket stream sender for dispatching
tungstenite::Message
. This stream object must have a mutable reference and can not be cloned. - WebSocket
Sink - WebSocketSink
tokio::sync::mpsc::UnboundedSender
for dispatching messages from within theWebSocketHandler::message
. This is anMPSC
channel that can be cloned and retained externally for the lifetime of the WebSocket connection.