pub struct CloseCode(/* private fields */);
Expand description
Close status code.
Implementations§
Source§impl CloseCode
impl CloseCode
Sourcepub const NORMAL_CLOSURE: Self
pub const NORMAL_CLOSURE: Self
Normal closure, meaning that the purpose for which the connection was established has been fulfilled.
Sourcepub const GOING_AWAY: Self
pub const GOING_AWAY: Self
Endpoint is “going away”, such as a server going down or a browser having navigated away from a page.
Sourcepub const PROTOCOL_ERROR: Self
pub const PROTOCOL_ERROR: Self
Endpoint is terminating the connection due to a protocol error.
Sourcepub const UNSUPPORTED_DATA: Self
pub const UNSUPPORTED_DATA: Self
Endpoint is terminating the connection because it has received a type of data it cannot accept.
Sourcepub const NO_STATUS_RECEIVED: Self
pub const NO_STATUS_RECEIVED: Self
No status code was actually present.
Sourcepub const INVALID_FRAME_PAYLOAD_DATA: Self
pub const INVALID_FRAME_PAYLOAD_DATA: Self
Endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message.
Sourcepub const POLICY_VIOLATION: Self
pub const POLICY_VIOLATION: Self
Endpoint is terminating the connection because it has received a message that violates its policy.
Sourcepub const MESSAGE_TOO_BIG: Self
pub const MESSAGE_TOO_BIG: Self
Endpoint is terminating the connection because it has received a message that is too big for it to process.
Sourcepub const MANDATORY_EXTENSION: Self
pub const MANDATORY_EXTENSION: Self
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.
Sourcepub const INTERNAL_SERVER_ERROR: Self
pub const INTERNAL_SERVER_ERROR: Self
Server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.
Sourcepub const SERVICE_RESTART: Self
pub const SERVICE_RESTART: Self
Service is restarted. A client may reconnect, and if it choses to do, should reconnect using a randomized delay of 5–30s.
Sourcepub const SERVICE_OVERLOAD: Self
pub const SERVICE_OVERLOAD: Self
Service is experiencing overload. A client should only connect to a different IP (when there are multiple for the target) or reconnect to the same IP upon user action.
Sourcepub const BAD_GATEWAY: Self
pub const BAD_GATEWAY: Self
The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to the HTTP 502 status code.