[][src]Enum embedded_websocket::WebSocketCloseStatusCode

pub enum WebSocketCloseStatusCode {
    NormalClosure,
    EndpointUnavailable,
    ProtocolError,
    InvalidMessageType,
    Reserved,
    Empty,
    InvalidPayloadData,
    PolicyViolation,
    MessageTooBig,
    MandatoryExtension,
    InternalServerError,
    TlsHandshake,
    Custom(u16),
}

Websocket close status code as per the rfc6455 websocket spec

Variants

NormalClosure

Normal closure (1000), meaning that the purpose for which the connection was established has been fulfilled

EndpointUnavailable

Endpoint unavailable (1001) indicates that an endpoint is "going away", such as a server going down or a browser having navigated away from a page

ProtocolError

Protocol error (1002) indicates that an endpoint is terminating the connection due to a protocol error.

InvalidMessageType

Invalid message type (1003) indicates that an endpoint is terminating the connection because it has received a type of data it cannot accept (e.g., an endpoint that understands only text data MAY send this if it receives a binary message)

Reserved

Reserved (1004) for future use

Empty

Empty (1005) indicates that no status code was present

InvalidPayloadData

Invalid payload data (1007) indicates that an endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 data within a text message)

PolicyViolation

Policy violation (1008) indicates that an endpoint is terminating the connection because it has received a message that violates its policy. This is a generic status code that can be returned when there is no other more suitable status code

MessageTooBig

Message too big (1009) indicates that an endpoint is terminating the connection because it has received a message that is too big for it to process

MandatoryExtension

Mandatory extension (1010) indicates that an endpoint (client) is terminating the connection because it has expected the server to negotiate one or more extension, but the server didn't return them in the response message of the WebSocket handshake

InternalServerError

Internal server error (1011) indicates that a server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request

TlsHandshake

TLS handshake (1015) connection was closed due to a failure to perform a TLS handshake

Custom(u16)

Custom close code

Trait Implementations

impl PartialEq<WebSocketCloseStatusCode> for WebSocketCloseStatusCode[src]

impl Debug for WebSocketCloseStatusCode[src]

impl Copy for WebSocketCloseStatusCode[src]

impl Clone for WebSocketCloseStatusCode[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

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> Into<U> for T where
    U: From<T>, 
[src]

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

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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self