pub struct CloseFrame<'a> {
pub code: u16,
pub reason: Cow<'a, str>,
}
Expand description
Information about a close message.
A close frame can be constructed via CloseFrame::new
. A default close
frame for causing a full session disconnect and for
causing a session resume are provided.
Fields§
§code: u16
Reason for the close.
reason: Cow<'a, str>
Textual representation of the reason the connection is being closed.
Implementations§
Source§impl<'a> CloseFrame<'a>
impl<'a> CloseFrame<'a>
Sourcepub const NORMAL: Self
pub const NORMAL: Self
Normal close code indicating the shard will not be reconnecting soon.
This frame will cause Discord to invalidate your session. If you intend
to resume your session soon, use RESUME
.
Trait Implementations§
Source§impl<'a> Clone for CloseFrame<'a>
impl<'a> Clone for CloseFrame<'a>
Source§fn clone(&self) -> CloseFrame<'a>
fn clone(&self) -> CloseFrame<'a>
Returns a copy 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<'a> Debug for CloseFrame<'a>
impl<'a> Debug for CloseFrame<'a>
Source§impl<'a> PartialEq for CloseFrame<'a>
impl<'a> PartialEq for CloseFrame<'a>
impl<'a> Eq for CloseFrame<'a>
impl<'a> StructuralPartialEq for CloseFrame<'a>
Auto Trait Implementations§
impl<'a> Freeze for CloseFrame<'a>
impl<'a> RefUnwindSafe for CloseFrame<'a>
impl<'a> Send for CloseFrame<'a>
impl<'a> Sync for CloseFrame<'a>
impl<'a> Unpin for CloseFrame<'a>
impl<'a> UnwindSafe for CloseFrame<'a>
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