Struct Disconnect
pub struct Disconnect<'a> {
pub reason_code: ReasonCode,
pub properties: &'a DisconnectProperties,
}Expand description
DISCONNECT packet signaling connection termination.
Fields§
§reason_code: ReasonCodeReason for disconnection.
properties: &'a DisconnectPropertiesDISCONNECT properties.
Implementations§
§impl<'a> Disconnect<'a>
impl<'a> Disconnect<'a>
pub const fn encoded_len(&self) -> usize
pub const fn encoded_len(&self) -> usize
Returns the encoded size of the variable header in bytes.
pub const fn encode(&self, w: &mut Writer<'_>) -> Result<(), EncodeError>
pub const fn encode(&self, w: &mut Writer<'_>) -> Result<(), EncodeError>
Encodes the DISCONNECT variable header into the writer.
§Errors
Returns EncodeError::InsufficientSpace if the writer does not have
enough capacity.
pub const fn decode(r: &mut Reader<'a>) -> Result<Self, DecodeError>
pub const fn decode(r: &mut Reader<'a>) -> Result<Self, DecodeError>
Decodes a DISCONNECT packet from the reader.
§Errors
Returns DecodeError if the data is malformed or contains an invalid
reason code or disallowed properties.
Trait Implementations§
§impl<'a> Clone for Disconnect<'a>
impl<'a> Clone for Disconnect<'a>
§fn clone(&self) -> Disconnect<'a>
fn clone(&self) -> Disconnect<'a>
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 more§impl<'a> Debug for Disconnect<'a>
impl<'a> Debug for Disconnect<'a>
§impl<'a> PartialEq for Disconnect<'a>
impl<'a> PartialEq for Disconnect<'a>
impl<'a> Eq for Disconnect<'a>
impl<'a> StructuralPartialEq for Disconnect<'a>
Auto Trait Implementations§
impl<'a> Freeze for Disconnect<'a>
impl<'a> RefUnwindSafe for Disconnect<'a>
impl<'a> Send for Disconnect<'a>
impl<'a> Sync for Disconnect<'a>
impl<'a> Unpin for Disconnect<'a>
impl<'a> UnwindSafe for Disconnect<'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