pub struct CloseMessage { /* private fields */ }
Available on crate feature
ws
only.Expand description
WS close message.
Implementations§
Source§impl CloseMessage
impl CloseMessage
pub const STATUS_OK: u16 = 1_000u16
pub const STATUS_GOING_AWAY: u16 = 1_001u16
pub const STATUS_PROTOCOL_ERROR: u16 = 1_002u16
pub const STATUS_UNEXPECTED_DATA: u16 = 1_003u16
pub const STATUS_INVALID_DATA: u16 = 1_007u16
pub const STATUS_TOO_BIG: u16 = 1_009u16
Sourcepub fn new<T>(status: u16, msg: T) -> Selfwhere
T: ToString,
pub fn new<T>(status: u16, msg: T) -> Selfwhere
T: ToString,
Create a new close message with a given status code and a given text message.
Sourcepub const fn new_static(status: u16, msg: &'static str) -> Self
pub const fn new_static(status: u16, msg: &'static str) -> Self
Create a new close message with a given status code and a given text message.
Trait Implementations§
Source§impl Clone for CloseMessage
impl Clone for CloseMessage
Source§fn clone(&self) -> CloseMessage
fn clone(&self) -> CloseMessage
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 From<CloseMessage> for Message
impl From<CloseMessage> for Message
Source§fn from(close: CloseMessage) -> Self
fn from(close: CloseMessage) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CloseMessage
impl RefUnwindSafe for CloseMessage
impl Send for CloseMessage
impl Sync for CloseMessage
impl Unpin for CloseMessage
impl UnwindSafe for CloseMessage
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