Expand description
§Embedded Websocket
embedded_websocket
facilitates the encoding and decoding of websocket frames and can be used
for both clients and servers. The library is intended to be used in constrained memory
environments like embedded microcontrollers which cannot reference the rust standard library.
It will work with arbitrarily small buffers regardless of websocket frame size as long as the
websocket header can be read (2 - 14 bytes depending on the payload size and masking).
Since the library is essentially an encoder or decoder of byte slices, the developer is free to
use whatever transport mechanism they chose. The examples in the source repository use the
TcpStream from the standard library.
Re-exports§
pub use self::random::EmptyRng;
Modules§
Structs§
- WebSocket
- Websocket client and server implementation
- WebSocket
Context - Websocket details extracted from the http header
- WebSocket
Options - Websocket options used by a websocket client to initiate an opening handshake with a websocket server
- WebSocket
Read Result - The metadata result of a
read
function call of a websocket
Enums§
- Client
- Error
- Websocket specific errors
- Server
- WebSocket
Close Status Code - Websocket close status code as per the rfc6455 websocket spec
- WebSocket
Receive Message Type - Websocket receive message type use when reading a websocket frame
- WebSocket
Send Message Type - Websocket send message type used when sending a websocket frame
- WebSocket
State - The state of the websocket
Traits§
Functions§
- read_
http_ header - Reads an http header and extracts websocket specific information from it.
Type Aliases§
- Result
- Result returning a websocket specific error if encountered
- WebSocket
Client - Used to return a sized type from
WebSocketClient::new_client()
- WebSocket
Key - A fixed length 24-character string used to hold a websocket key for the opening handshake
- WebSocket
Server - Used to return a sized type from
WebSocket::new_server()
- WebSocket
SubProtocol - A maximum sized 24-character string used to store a sub protocol (e.g.
chat
)