Struct Auth
pub struct Auth<'a> {
pub reason_code: ReasonCode,
pub properties: &'a AuthProperties,
}Expand description
AUTH packet for enhanced authentication.
Fields§
§reason_code: ReasonCodeAuthentication reason code.
properties: &'a AuthPropertiesAUTH properties.
Implementations§
§impl<'a> Auth<'a>
impl<'a> Auth<'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 AUTH 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 an AUTH 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> Eq for Auth<'a>
impl<'a> StructuralPartialEq for Auth<'a>
Auto Trait Implementations§
impl<'a> Freeze for Auth<'a>
impl<'a> RefUnwindSafe for Auth<'a>
impl<'a> Send for Auth<'a>
impl<'a> Sync for Auth<'a>
impl<'a> Unpin for Auth<'a>
impl<'a> UnwindSafe for Auth<'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