Enum ProtocolError

enum ProtocolError

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(http::header::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(httparse::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(crate::protocol::frame::coding::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.

Implementations

impl Clone for ProtocolError

fn clone(self: &Self) -> ProtocolError

impl Debug for ProtocolError

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Display for ProtocolError

fn fmt(self: &Self, __formatter: &mut Formatter<'_>) -> Result

impl Eq for ProtocolError

impl Error for ProtocolError

fn source(self: &Self) -> Option<&dyn Error + 'static>

impl Freeze for ProtocolError

impl From for ProtocolError

fn from(source: Error) -> Self

impl PartialEq for ProtocolError

fn eq(self: &Self, other: &ProtocolError) -> bool

impl RefUnwindSafe for ProtocolError

impl Send for ProtocolError

impl StructuralPartialEq for ProtocolError

impl Sync for ProtocolError

impl Unpin for ProtocolError

impl UnsafeUnpin for ProtocolError

impl UnwindSafe for ProtocolError

impl<T> Any for ProtocolError

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for ProtocolError

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for ProtocolError

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for ProtocolError

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for ProtocolError

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Same for ProtocolError

impl<T> ToOwned for ProtocolError

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T> ToString for ProtocolError

fn to_string(self: &Self) -> String

impl<T, U> Into for ProtocolError

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for ProtocolError

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for ProtocolError

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>

impl<V, T> VZip for ProtocolError

fn vzip(self: Self) -> V