pub struct Disconnect {
pub session_id: u32,
pub reason: DisconnectReason,
}Expand description
A packet used to terminate a session. Serialized without OP code or CRC.
Fields§
§session_id: u32The ID of the session being terminated.
reason: DisconnectReasonThe reason for the termination.
Implementations§
Source§impl Disconnect
impl Disconnect
Sourcepub fn new(session_id: u32, reason: DisconnectReason) -> Self
pub fn new(session_id: u32, reason: DisconnectReason) -> Self
Creates a new disconnect packet.
Sourcepub fn deserialize(buffer: &[u8]) -> Result<Self>
pub fn deserialize(buffer: &[u8]) -> Result<Self>
Deserializes a packet from buffer.
Trait Implementations§
Source§impl Clone for Disconnect
impl Clone for Disconnect
Source§fn clone(&self) -> Disconnect
fn clone(&self) -> Disconnect
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Disconnect
Source§impl Debug for Disconnect
impl Debug for Disconnect
impl Eq for Disconnect
Source§impl PartialEq for Disconnect
impl PartialEq for Disconnect
Source§fn eq(&self, other: &Disconnect) -> bool
fn eq(&self, other: &Disconnect) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Disconnect
Auto Trait Implementations§
impl Freeze for Disconnect
impl RefUnwindSafe for Disconnect
impl Send for Disconnect
impl Sync for Disconnect
impl Unpin for Disconnect
impl UnsafeUnpin for Disconnect
impl UnwindSafe for Disconnect
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