[][src]Enum ws_stream_wasm::error::ErrorKind

pub enum ErrorKind {
    InvalidWsState {
        supplied: u16,
    },
    ConnectionNotOpen,
    ForbiddenPort,
    InvalidUrl {
        supplied: String,
    },
    InvalidCloseCode {
        supplied: u16,
    },
    ReasonStringToLong,
    ConnectionFailed {
        event: CloseEvent,
    },
    // some variants omitted
}

The different kind of errors that can happen when you use the ws_stream API.

Variants

InvalidWsState

Invalid input to WsState::try_from( u16 )

Fields of InvalidWsState

supplied: u16

The user supplied value that is in valid

ConnectionNotOpen

When trying to send and WsState is anything but WsState::Open this error is returned. //

ForbiddenPort

Browsers will forbid making websocket connections to certain ports. See this Stack Overflow question.

InvalidUrl

An invalid URL was given to WsStream::connect, please see: HTML Living Standard

Fields of InvalidUrl

supplied: String

The user supplied value that is in valid

InvalidCloseCode

An invalid close code was given to a close method. For valid close codes, please see: MDN Documentation

Fields of InvalidCloseCode

supplied: u16

The user supplied value that is in valid

ReasonStringToLong

The reason string given to a close method is longer than 123 bytes, please see: MDN Documentation

ConnectionFailed

Failed to connect to the server.

Fields of ConnectionFailed

event: CloseEvent

The close event that might hold extra code and reason information.

Trait Implementations

impl Eq for ErrorKind[src]

impl Clone for ErrorKind[src]

impl PartialEq<ErrorKind> for ErrorKind[src]

impl From<ErrorKind> for Error[src]

impl Debug for ErrorKind[src]

impl Display for ErrorKind[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,