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
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
impl Clone for WebSocketCloseStatusCode
source§fn clone(&self) -> WebSocketCloseStatusCode
fn clone(&self) -> WebSocketCloseStatusCode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WebSocketCloseStatusCode
impl Debug for WebSocketCloseStatusCode
source§impl PartialEq<WebSocketCloseStatusCode> for WebSocketCloseStatusCode
impl PartialEq<WebSocketCloseStatusCode> for WebSocketCloseStatusCode
source§fn eq(&self, other: &WebSocketCloseStatusCode) -> bool
fn eq(&self, other: &WebSocketCloseStatusCode) -> bool
self
and other
values to be equal, and is used
by ==
.