Enum ws::ErrorKind [] [src]

pub enum ErrorKind {
    Internal,
    Capacity,
    Protocol,
    Encoding(Utf8Error),
    Io(Error),
    Parse(Error),
    Queue(NotifyError<Command>),
    Custom(Box<StdError>),
}

The type of an error, which may indicate other kinds of errors as the underlying cause.

Variants

Internal

Indicates an internal application error. The WebSocket will automatically attempt to send an Error (1011) close code.

Capacity

Indicates a state where some size limit has been exceeded, such as an inability to accept any more new connections. If a Connection is active, the WebSocket will automatically attempt to send a Size (1009) close code.

Protocol

Indicates a violation of the WebSocket protocol. The WebSocket will automatically attempt to send a Protocol (1002) close code, or if this error occurs during a handshake, an HTTP 400 reponse will be generated.

Encoding(Utf8Error)

Indicates that the WebSocket received data that should be utf8 encoded but was not. The WebSocket will automatically attempt to send a Invalid Frame Payload Data (1007) close code.

Io(Error)

Indicates an underlying IO Error. This kind of error will result in a WebSocket Connection disconnecting.

Parse(Error)

Indicates a failure to parse an HTTP message. This kind of error should only occur during a WebSocket Handshake, and a HTTP 500 response will be generated.

Queue(NotifyError<Command>)

Indicates a failure to send a command on the internal EventLoop channel. This means that the WebSocket is overloaded and the Connection will disconnect.

Custom(Box<StdError>)

A custom error kind for use by applications. This error kind involves extra overhead because it will allocate the memory on the heap. The WebSocket ignores such errors by default, simply passing them to the Connection Handler.

Trait Implementations

impl Debug for Kind
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.