#[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 moreSource§impl Debug for WebSocketCloseCode
impl Debug for WebSocketCloseCode
Source§impl PartialEq for WebSocketCloseCode
impl PartialEq for WebSocketCloseCode
impl Copy for WebSocketCloseCode
impl Eq for WebSocketCloseCode
impl StructuralPartialEq for WebSocketCloseCode
Auto Trait Implementations§
impl Freeze for WebSocketCloseCode
impl RefUnwindSafe for WebSocketCloseCode
impl Send for WebSocketCloseCode
impl Sync for WebSocketCloseCode
impl Unpin for WebSocketCloseCode
impl UnsafeUnpin for WebSocketCloseCode
impl UnwindSafe for WebSocketCloseCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more