pub struct CloseFrame {
pub code: u16,
pub reason: String,
}Expand description
A WebSocket close frame.
Mirrors the RFC 6455 close payload: a 16-bit status code followed by an optional UTF-8 reason string.
Fields§
§code: u16RFC 6455 close status code.
reason: StringHuman-readable reason string. Empty if no reason was provided.
Implementations§
Source§impl CloseFrame
impl CloseFrame
Sourcepub const GOING_AWAY: u16 = 1001
pub const GOING_AWAY: u16 = 1001
Going away (1001).
Sourcepub const PROTOCOL_ERROR: u16 = 1002
pub const PROTOCOL_ERROR: u16 = 1002
Protocol error (1002).
Sourcepub const UNSUPPORTED: u16 = 1003
pub const UNSUPPORTED: u16 = 1003
Unsupported data (1003).
Sourcepub const POLICY_VIOLATION: u16 = 1008
pub const POLICY_VIOLATION: u16 = 1008
Policy violation (1008).
Sourcepub const MESSAGE_TOO_LARGE: u16 = 1009
pub const MESSAGE_TOO_LARGE: u16 = 1009
Message too large (1009).
Sourcepub const INTERNAL_ERROR: u16 = 1011
pub const INTERNAL_ERROR: u16 = 1011
Internal server error (1011).
Trait Implementations§
Source§impl Clone for CloseFrame
impl Clone for CloseFrame
Source§fn clone(&self) -> CloseFrame
fn clone(&self) -> CloseFrame
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CloseFrame
impl Debug for CloseFrame
Source§impl From<CloseFrame> for CloseFrame
impl From<CloseFrame> for CloseFrame
Source§impl From<CloseFrame> for CloseFrame
impl From<CloseFrame> for CloseFrame
Source§fn from(value: CloseFrame) -> Self
fn from(value: CloseFrame) -> Self
Converts to this type from the input type.
Source§impl From<CloseFrame> for CloseReason
impl From<CloseFrame> for CloseReason
Source§fn from(value: CloseFrame) -> Self
fn from(value: CloseFrame) -> Self
Converts to this type from the input type.
Source§impl From<CloseReason> for CloseFrame
impl From<CloseReason> for CloseFrame
Source§impl PartialEq for CloseFrame
impl PartialEq for CloseFrame
impl Eq for CloseFrame
impl StructuralPartialEq for CloseFrame
Auto Trait Implementations§
impl Freeze for CloseFrame
impl RefUnwindSafe for CloseFrame
impl Send for CloseFrame
impl Sync for CloseFrame
impl Unpin for CloseFrame
impl UnsafeUnpin for CloseFrame
impl UnwindSafe for CloseFrame
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§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>
Converts
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>
Converts
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