#[repr(u16)]pub enum WebSocketCloseCode {
Clean = 1_000,
Leaving = 1_001,
ProtocolError = 1_002,
Error = 1_011,
AuthFailed = 4_106,
AuthTimeout = 4_107,
Kicked = 4_108,
RoomFull = 4_109,
}Expand description
websocket close code vocabulary shared by server and browser protocol code
standard codes keep their RFC meaning custom codes mirror the legacy Odoo SFU websocket close vocabulary used by browser clients and low-cardinality telemetry
Variants§
Clean = 1_000
normal websocket closure
Leaving = 1_001
the peer is leaving
ProtocolError = 1_002
the peer sent a malformed or invalid protocol message
Error = 1_011
the server hit an internal error while handling the socket
AuthFailed = 4_106
authentication failed
AuthTimeout = 4_107
the client did not authenticate before the server timeout
Kicked = 4_108
the runtime removed this client from the room
RoomFull = 4_109
admission failed because the room cannot accept another user
Implementations§
Source§impl WebSocketCloseCode
impl WebSocketCloseCode
Sourcepub const fn from_u16(value: u16) -> Option<WebSocketCloseCode>
pub const fn from_u16(value: u16) -> Option<WebSocketCloseCode>
decode a raw websocket close code if it belongs to the shared vocabulary
unknown codes return None so the caller can keep foreign websocket
close reasons out of application telemetry labels and protocol state
machines
Trait Implementations§
Source§impl Clone for WebSocketCloseCode
impl Clone for WebSocketCloseCode
Source§fn clone(&self) -> WebSocketCloseCode
fn clone(&self) -> WebSocketCloseCode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more