Struct Unsuback
pub struct Unsuback<'a> {
pub packet_id: PacketId,
pub properties: &'a UnsubackProperties,
pub reason_codes: &'a [u8],
}Expand description
UNSUBACK packet acknowledging an UNSUBSCRIBE.
Fields§
§packet_id: PacketIdPacket identifier matching the UNSUBSCRIBE.
properties: &'a UnsubackPropertiesUNSUBACK properties.
reason_codes: &'a [u8]One reason code per topic filter.
Implementations§
§impl<'a> Unsuback<'a>
impl<'a> Unsuback<'a>
pub const fn encoded_len(&self) -> usize
pub const fn encoded_len(&self) -> usize
Returns the encoded size of the variable header + payload in bytes.
pub const fn encode(&self, w: &mut Writer<'_>) -> Result<(), EncodeError>
pub const fn encode(&self, w: &mut Writer<'_>) -> Result<(), EncodeError>
Encodes the UNSUBACK variable header + payload 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 UNSUBACK packet from the reader.
§Errors
Returns DecodeError if the data is malformed, the packet ID is
zero, or properties contain disallowed IDs.
Trait Implementations§
impl<'a> Eq for Unsuback<'a>
impl<'a> StructuralPartialEq for Unsuback<'a>
Auto Trait Implementations§
impl<'a> Freeze for Unsuback<'a>
impl<'a> RefUnwindSafe for Unsuback<'a>
impl<'a> Send for Unsuback<'a>
impl<'a> Sync for Unsuback<'a>
impl<'a> Unpin for Unsuback<'a>
impl<'a> UnwindSafe for Unsuback<'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