pub enum ProtocolError {
Show 26 variants
InvalidHttpMethod,
InvalidHttpVersion,
InvalidHeader(HeaderName),
MissingConnectionUpgradeHeader,
MissingUpgradeHeader,
MissingVersionHeader,
MissingKeyHeader,
AcceptKeyMismatch,
SecWebSocketSubProtocolError(SubProtocolError),
IncompleteHandshake,
HttparseError(Error),
NonZeroReservedBits,
FragmentedControlFrame,
ControlFrameTooBig,
UnmaskedFrameFromClient,
MaskedFrameFromServer,
UnknownControlOpCode(u8),
UnknownDataOpCode(u8),
UnexpectedContinue,
ExpectedFragment(Data),
SendAfterClose,
ReceiveAfterClose,
InvalidCloseFrame,
ResetWithoutClosing,
JunkAfterRequest,
CustomResponseSuccessful,
}Expand description
Indicates the specific type/cause of a protocol error.
Variants§
InvalidHttpMethod
Use of the wrong HTTP method (the WebSocket protocol requires the GET method be used).
InvalidHttpVersion
Wrong HTTP version used (the WebSocket protocol requires version 1.1 or higher).
InvalidHeader(HeaderName)
Invalid header is passed. Or the header is missing in the request. Or not present at all. Check the request that you pass.
MissingConnectionUpgradeHeader
Missing Connection: upgrade HTTP header.
MissingUpgradeHeader
Missing Upgrade: websocket HTTP header.
MissingVersionHeader
Missing Sec-WebSocket-Version: 13 HTTP header.
MissingKeyHeader
Missing Sec-WebSocket-Key HTTP header.
AcceptKeyMismatch
The Sec-WebSocket-Accept header is either not present or does not specify the correct key value.
SecWebSocketSubProtocolError(SubProtocolError)
The Sec-WebSocket-Protocol header was invalid
IncompleteHandshake
No more data while still performing handshake.
HttparseError(Error)
Wrapper around a httparse::Error value.
NonZeroReservedBits
Reserved bits in frame header are non-zero.
FragmentedControlFrame
Control frames must not be fragmented.
ControlFrameTooBig
Control frames must have a payload of 125 bytes or less.
UnmaskedFrameFromClient
The server must close the connection when an unmasked frame is received.
MaskedFrameFromServer
The client must close the connection when a masked frame is received.
UnknownControlOpCode(u8)
Encountered an invalid controlopcode.
UnknownDataOpCode(u8)
Encountered an invalid data opcode.
UnexpectedContinue
Received a continue frame despite there being nothing to continue.
ExpectedFragment(Data)
Received data while waiting for more fragments.
SendAfterClose
Not allowed to send after having sent a closing frame.
ReceiveAfterClose
Remote sent data after sending a closing frame.
InvalidCloseFrame
The payload for the closing frame is invalid.
ResetWithoutClosing
Connection closed without performing the closing handshake.
JunkAfterRequest
Garbage data encountered after client request.
CustomResponseSuccessful
Custom responses must be unsuccessful.
Trait Implementations§
Source§impl Clone for ProtocolError
impl Clone for ProtocolError
Source§fn clone(&self) -> ProtocolError
fn clone(&self) -> ProtocolError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more