Struct Connack
pub struct Connack<'a> {
pub session_present: bool,
pub reason_code: ReasonCode,
pub properties: &'a ConnackProperties,
}Expand description
CONNACK packet sent by the server in response to CONNECT.
Fields§
§session_present: boolWhether the server has a session state for this client.
reason_code: ReasonCodeConnection result reason code.
properties: &'a ConnackPropertiesCONNACK properties (server capabilities).
Implementations§
§impl<'a> Connack<'a>
impl<'a> Connack<'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 CONNACK 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 CONNACK packet from the reader.
§Errors
Returns DecodeError if the data is malformed, flags are invalid,
or properties contain disallowed IDs.
Trait Implementations§
impl<'a> Eq for Connack<'a>
impl<'a> StructuralPartialEq for Connack<'a>
Auto Trait Implementations§
impl<'a> Freeze for Connack<'a>
impl<'a> RefUnwindSafe for Connack<'a>
impl<'a> Send for Connack<'a>
impl<'a> Sync for Connack<'a>
impl<'a> Unpin for Connack<'a>
impl<'a> UnwindSafe for Connack<'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