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

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§

source§

impl Clone for WebSocketCloseStatusCode

source§

fn clone(&self) -> WebSocketCloseStatusCode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WebSocketCloseStatusCode

source§

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

Formats the value using the given formatter. Read more
source§

impl PartialEq<WebSocketCloseStatusCode> for WebSocketCloseStatusCode

source§

fn eq(&self, other: &WebSocketCloseStatusCode) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for WebSocketCloseStatusCode

source§

impl Eq for WebSocketCloseStatusCode

source§

impl StructuralEq for WebSocketCloseStatusCode

source§

impl StructuralPartialEq for WebSocketCloseStatusCode

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.