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: CloseFrame<'a>
pub const NORMAL: CloseFrame<'a>
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
.
Sourcepub const RESUME: CloseFrame<'a>
pub const RESUME: CloseFrame<'a>
Close code indicating the shard will be reconnecting soon.
This frame will cause Discord to keep your session alive. If you
don’t intend to resume your session soon, use NORMAL
.
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
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
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.