Enum ErrorKind

Source
pub enum ErrorKind {
    CloseSingal,
    OutNotEnough,
    Internal,
    Capacity,
    Protocol,
    Encoding(Utf8Error),
    Io(Error),
    Http(Error),
    Custom(Box<dyn StdError + Send + Sync>),
}
Expand description

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

Variants§

§

CloseSingal

Receive read size is equal zero. We will close the socket

§

OutNotEnough

Out Buff not enough. We will close the socket

§

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.

§

Http(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.

§

Custom(Box<dyn StdError + Send + Sync>)

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§

Source§

impl Debug for Kind

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Kind

§

impl !RefUnwindSafe for Kind

§

impl Send for Kind

§

impl Sync for Kind

§

impl Unpin for Kind

§

impl !UnwindSafe for Kind

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.