Enum ProtocolError
pub enum ProtocolError {
Show 27 variants
WrongHttpMethod,
WrongHttpVersion,
MissingConnectionUpgradeHeader,
MissingUpgradeWebSocketHeader,
MissingSecWebSocketVersionHeader,
MissingSecWebSocketKey,
SecWebSocketAcceptKeyMismatch,
SecWebSocketSubProtocolError(SubProtocolError),
JunkAfterRequest,
CustomResponseSuccessful,
InvalidHeader(Box<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.
SecWebSocketSubProtocolError(SubProtocolError)
The Sec-WebSocket-Protocol header was invalid
JunkAfterRequest
Garbage data encountered after client request.
CustomResponseSuccessful
Custom responses must be unsuccessful.
InvalidHeader(Box<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§
§impl Clone for ProtocolError
impl Clone for ProtocolError
§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§impl Debug for ProtocolError
impl Debug for ProtocolError
§impl Display for ProtocolError
impl Display for ProtocolError
§impl Error for ProtocolError
impl Error for ProtocolError
§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
§impl From<Error> for ProtocolError
impl From<Error> for ProtocolError
§fn from(source: Error) -> ProtocolError
fn from(source: Error) -> ProtocolError
§impl From<ProtocolError> for Error
impl From<ProtocolError> for Error
§fn from(source: ProtocolError) -> Error
fn from(source: ProtocolError) -> Error
§impl PartialEq for ProtocolError
impl PartialEq for ProtocolError
impl Eq for ProtocolError
impl StructuralPartialEq for ProtocolError
Auto Trait Implementations§
impl Freeze for ProtocolError
impl RefUnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl UnwindSafe for ProtocolError
Blanket Implementations§
§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
§impl<E> InstrumentError for Ewhere
TracedError<E>: From<E>,
impl<E> InstrumentError for Ewhere
TracedError<E>: From<E>,
§type Instrumented = TracedError<E>
type Instrumented = TracedError<E>
§fn in_current_span(self) -> <E as InstrumentError>::Instrumented
fn in_current_span(self) -> <E as InstrumentError>::Instrumented
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.