Module websocket

Source
Expand description

Contains useful WebSocket type aliases and a default WebSocket implementation of a StreamParser.

Structs§

WebSocketParser
Default StreamParser implementation for a WebSocket.

Functions§

connect
Connect asynchronously to a WebSocket server.
is_websocket_disconnected
Determine whether a WsError indicates the WebSocket has disconnected.
process_binary
Process a payload of Vec<u8> bytes by deserialising into an ExchangeMessage.
process_close_frame
Basic process for a WebSocket CloseFrame message. Logs the payload at trace level.
process_frame
Basic process for a WebSocket Frame message. Logs the payload at trace level.
process_ping
Basic process for a WebSocket ping message. Logs the payload at trace level.
process_pong
Basic process for a WebSocket pong message. Logs the payload at trace level.
process_text
Process a payload of String by deserialising into an ExchangeMessage.

Type Aliases§

WebSocket
Convenient type alias for a tungstenite WebSocketStream.
WsError
Communicative type alias for a tungstenite WebSocket Error.
WsMessage
Communicative type alias for a tungstenite WebSocket Message.
WsSink
Convenient type alias for the Sink half of a tungstenite WebSocket.
WsStream
Convenient type alias for the Stream half of a tungstenite WebSocket.