Expand description
Ratchet’s core implementation. See the Ratchet crate for usage.
Modules§
- server
- Provides utilities for handling WebSocket handshakes on the server side.
Structs§
- Close
Reason - A reason for closing the WebSocket connection.
- Error
- The errors that may occur during a WebSocket connection.
- Invalid
Header - An invalid header was received.
- NoExt
- An extension stub that does nothing.
- NoExt
Decoder - NoExt
Encoder - NoExt
Provider - An extension provider stub that will always succeed with
NoExt
. - Subprotocol
Registry - A subprotocol registry that is used for negotiating a possible subprotocol to use for a connection.
- Upgraded
Client - A structure representing an upgraded WebSocket session and an optional subprotocol that was negotiated during the upgrade.
- Upgraded
Server - A structure representing an upgraded WebSocket session and an optional subprotocol that was negotiated during the upgrade.
- WebSocket
- An upgraded WebSocket stream.
- WebSocket
Client Builder - A builder to construct WebSocket clients.
- WebSocket
Config - A configuration for building a WebSocket.
- WebSocket
Response - A response to send to a client if the connection will not be upgraded.
- WebSocket
Server Builder - A builder to construct WebSocket servers.
- WebSocket
Upgrader - Represents a client connection that has been accepted and the upgrade request validated. This may be used to validate the request by a user and opt to either continue the upgrade or reject the connection - such as if the target path does not exist.
Enums§
- Close
Cause - The channel is closed
- Close
Code - Additional implementation sources:
- Close
State - Denotes the current state of a WebSocket session.
- Error
Kind - A type of error represented.
- Http
Error - HTTP errors.
- Message
- A received WebSocket frame.
- Message
Type - A message type to send.
- Payload
Type - The type of a payload to send to a peer.
- Protocol
Error - WebSocket protocol errors.
- Role
- The role of a WebSocket.
Traits§
- TryInto
Request - A trait for creating a request from a type.
- WebSocket
Stream - A stream representing a WebSocket connection.
Functions§
- accept
- Execute a server handshake on the provided stream.
- accept_
with - Execute a server handshake on the provided stream. An attempt will be made to negotiate the extension and subprotocols provided.
- subscribe
- Execute a WebSocket client handshake on
stream
, opting for no compression on messages and no subprotocol. - subscribe_
with - Execute a WebSocket client handshake on
stream
, attempting to negotiate the extension and a subprotocol.