Enum websockets::WebSocketError[][src]

pub enum WebSocketError {
Show 21 variants TcpConnectionError(IoError), TlsConnectionError(NativeTlsError), TlsBuilderError(NativeTlsError), TlsConfigurationError(NativeTlsError), WebSocketClosedError, ShutdownError(IoError), InvalidHandshakeError, HandshakeFailedError { status_code: String, headers: Vec<(String, String)>, body: Option<String>, }, ControlFrameTooLargeError, PayloadTooLargeError, InvalidFrameError, ReceivedMaskedFrameError, ParseError(ParseError), SchemeError, HostError, PortError, SocketAddrError(IoError), ResolutionError, ReadError(IoError), WriteError(IoError), ChannelError,
}
Expand description

The possible error types from the WebSocket connection.

Variants

TcpConnectionError(IoError)

Error connecting using TCP

TlsConnectionError(NativeTlsError)

Error connecting using TLS

TlsBuilderError(NativeTlsError)

Error building WebSocket with given TLS configuration

TlsConfigurationError(NativeTlsError)

Error creating a TLS configuration (such as in method calls on TlsCertificate or TlsIdentity)

WebSocketClosedError

Attempted to use the WebSocket when it is already closed

ShutdownError(IoError)

Error shutting down the internal stream

InvalidHandshakeError

Invalid handshake response from the server

HandshakeFailedError

The server rejected the handshake request

Fields of HandshakeFailedError

status_code: String

Status code from the server’s handshake response

headers: Vec<(String, String)>

Headers from the server’s handshake response

body: Option<String>

Body of the server’s handshake response, if any

ControlFrameTooLargeError

Attempted to use a control frame whose payload is more than 125 bytes

PayloadTooLargeError

Attempted to use a frame whose payload is too large

InvalidFrameError

Received an invalid frame

ReceivedMaskedFrameError

Received a masked frame from the server

ParseError(ParseError)

URL could not be parsed

SchemeError

URL has invalid WebSocket scheme (use “ws” or “wss”)

HostError

URL host is invalid or missing

PortError

URL port is invalid

SocketAddrError(IoError)

Could not parse URL into SocketAddrs

ResolutionError

Could not resolve the URL’s domain

ReadError(IoError)

Error reading from WebSocket

WriteError(IoError)

Error writing to WebSocket

ChannelError

Issue with mpsc channel

Trait Implementations

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

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

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.