Struct twilight_model::gateway::CloseFrame
source · 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: u16Reason 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<CloseFrame<'a>> for CloseFrame<'a>
impl<'a> PartialEq<CloseFrame<'a>> for CloseFrame<'a>
source§fn eq(&self, other: &CloseFrame<'a>) -> bool
fn eq(&self, other: &CloseFrame<'a>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl<'a> Eq for CloseFrame<'a>
impl<'a> StructuralEq for CloseFrame<'a>
impl<'a> StructuralPartialEq for CloseFrame<'a>
Auto Trait Implementations§
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