pub struct SocketCloseCode(pub u16);Expand description
Wrapper type around a CloseEvent code, indicating why the WebSocket was closed
Tuple Fields§
§0: u16Implementations§
Source§impl SocketCloseCode
impl SocketCloseCode
Sourcepub const NORMAL_CLOSURE: SocketCloseCode
pub const NORMAL_CLOSURE: SocketCloseCode
Normal closure; the connection successfully completed whatever purpose for which it was created.
Sourcepub const GOING_AWAY: SocketCloseCode
pub const GOING_AWAY: SocketCloseCode
The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection.
Sourcepub const PROTOCOL_ERROR: SocketCloseCode
pub const PROTOCOL_ERROR: SocketCloseCode
The endpoint is terminating the connection due to a protocol error.
Sourcepub const UNSUPPORTED_DATA: SocketCloseCode
pub const UNSUPPORTED_DATA: SocketCloseCode
The connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data).
Sourcepub const NO_STATUS_RECEIVED: SocketCloseCode
pub const NO_STATUS_RECEIVED: SocketCloseCode
Reserved. Indicates that no status code was provided even though one was expected.
Sourcepub const ABNORMAL_CLOSURE: SocketCloseCode
pub const ABNORMAL_CLOSURE: SocketCloseCode
Reserved. Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected.
Sourcepub const INVALID_FRAME_PAYLOAD_DATA: SocketCloseCode
pub const INVALID_FRAME_PAYLOAD_DATA: SocketCloseCode
The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message).
Sourcepub const POLICY_VIOLATION: SocketCloseCode
pub const POLICY_VIOLATION: SocketCloseCode
The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable.
Sourcepub const MESSAGE_TOO_BIG: SocketCloseCode
pub const MESSAGE_TOO_BIG: SocketCloseCode
The endpoint is terminating the connection because a data frame was received that is too large.
Sourcepub const MISSING_EXTENSION: SocketCloseCode
pub const MISSING_EXTENSION: SocketCloseCode
The client is terminating the connection because it expected the server to negotiate one or more extensions, but the server didn’t.
Sourcepub const INTERNAL_ERROR: SocketCloseCode
pub const INTERNAL_ERROR: SocketCloseCode
The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.
Sourcepub const SERVICE_RESTART: SocketCloseCode
pub const SERVICE_RESTART: SocketCloseCode
The server is terminating the connection because it is restarting.
Sourcepub const TRY_AGAIN_LATER: SocketCloseCode
pub const TRY_AGAIN_LATER: SocketCloseCode
The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients.
Sourcepub const BAD_GATEWAY: SocketCloseCode
pub const BAD_GATEWAY: SocketCloseCode
The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code.
Sourcepub const TLS_HANDSHAKE: SocketCloseCode
pub const TLS_HANDSHAKE: SocketCloseCode
Reserved. Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can’t be verified).
Trait Implementations§
Source§impl Clone for SocketCloseCode
impl Clone for SocketCloseCode
Source§fn clone(&self) -> SocketCloseCode
fn clone(&self) -> SocketCloseCode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more