Enum tungstenite::error::ProtocolError[][src]

pub enum ProtocolError {
Show variants WrongHttpMethod, WrongHttpVersion, MissingConnectionUpgradeHeader, MissingUpgradeWebSocketHeader, MissingSecWebSocketVersionHeader, MissingSecWebSocketKey, SecWebSocketAcceptKeyMismatch, JunkAfterRequest, CustomResponseSuccessful, 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.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.