Enum tungstenite::error::ProtocolError
source · [−]pub enum ProtocolError {
Show 26 variants
WrongHttpMethod,
WrongHttpVersion,
MissingConnectionUpgradeHeader,
MissingUpgradeWebSocketHeader,
MissingSecWebSocketVersionHeader,
MissingSecWebSocketKey,
SecWebSocketAcceptKeyMismatch,
JunkAfterRequest,
CustomResponseSuccessful,
InvalidHeader(HeaderName),
HandshakeIncomplete,
HttparseError(Error),
SendAfterClosing,
ReceivedAfterClosing,
NonZeroReservedBits,
UnmaskedFrameFromClient,
MaskedFrameFromServer,
FragmentedControlFrame,
ControlFrameTooBig,
UnknownControlFrameType(u8),
UnknownDataFrameType(u8),
UnexpectedContinueFrame,
ExpectedFragment(Data),
ResetWithoutClosingHandshake,
InvalidOpcode(u8),
InvalidCloseSequence,
}Expand description
Indicates the specific type/cause of a protocol error.
Variants
WrongHttpMethod
Use of the wrong HTTP method (the WebSocket protocol requires the GET method be used).
WrongHttpVersion
Wrong HTTP version used (the WebSocket protocol requires version 1.1 or higher).
MissingConnectionUpgradeHeader
Missing Connection: upgrade HTTP header.
MissingUpgradeWebSocketHeader
Missing Upgrade: websocket HTTP header.
MissingSecWebSocketVersionHeader
Missing Sec-WebSocket-Version: 13 HTTP header.
MissingSecWebSocketKey
Missing Sec-WebSocket-Key HTTP header.
SecWebSocketAcceptKeyMismatch
The Sec-WebSocket-Accept header is either not present or does not specify the correct key value.
JunkAfterRequest
Garbage data encountered after client request.
CustomResponseSuccessful
Custom responses must be unsuccessful.
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.
HandshakeIncomplete
No more data while still performing handshake.
HttparseError(Error)
Wrapper around a httparse::Error value.
SendAfterClosing
Not allowed to send after having sent a closing frame.
ReceivedAfterClosing
Remote sent data after sending a closing frame.
NonZeroReservedBits
Reserved bits in frame header are non-zero.
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.
FragmentedControlFrame
Control frames must not be fragmented.
ControlFrameTooBig
Control frames must have a payload of 125 bytes or less.
UnknownControlFrameType(u8)
Type of control frame not recognised.
UnknownDataFrameType(u8)
Type of data frame not recognised.
UnexpectedContinueFrame
Received a continue frame despite there being nothing to continue.
ExpectedFragment(Data)
Received data while waiting for more fragments.
ResetWithoutClosingHandshake
Connection closed without performing the closing handshake.
InvalidOpcode(u8)
Encountered an invalid opcode.
InvalidCloseSequence
The payload for the closing frame is invalid.
Trait Implementations
sourceimpl Clone for ProtocolError
impl Clone for ProtocolError
sourcefn clone(&self) -> ProtocolError
fn clone(&self) -> ProtocolError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for ProtocolError
impl Debug for ProtocolError
sourceimpl Display for ProtocolError
impl Display for ProtocolError
sourceimpl Error for ProtocolError
impl Error for ProtocolError
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<Error> for ProtocolError
impl From<Error> for ProtocolError
sourceimpl From<ProtocolError> for Error
impl From<ProtocolError> for Error
sourcefn from(source: ProtocolError) -> Self
fn from(source: ProtocolError) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<ProtocolError> for ProtocolError
impl PartialEq<ProtocolError> for ProtocolError
sourcefn eq(&self, other: &ProtocolError) -> bool
fn eq(&self, other: &ProtocolError) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ProtocolError) -> bool
fn ne(&self, other: &ProtocolError) -> bool
This method tests for !=.
impl Eq for ProtocolError
impl StructuralEq for ProtocolError
impl StructuralPartialEq for ProtocolError
Auto Trait Implementations
impl RefUnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl UnwindSafe for ProtocolError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more