Struct Suback
pub struct Suback<'a> {
pub packet_id: PacketId,
pub properties: &'a SubackProperties,
pub reason_codes: &'a [u8],
}Expand description
SUBACK packet acknowledging a SUBSCRIBE.
Fields§
§packet_id: PacketIdPacket identifier matching the SUBSCRIBE.
properties: &'a SubackPropertiesSUBACK properties.
reason_codes: &'a [u8]One reason code per subscription entry.
Implementations§
§impl<'a> Suback<'a>
impl<'a> Suback<'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 SUBACK 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 a SUBACK 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 Suback<'a>
impl<'a> StructuralPartialEq for Suback<'a>
Auto Trait Implementations§
impl<'a> Freeze for Suback<'a>
impl<'a> RefUnwindSafe for Suback<'a>
impl<'a> Send for Suback<'a>
impl<'a> Sync for Suback<'a>
impl<'a> Unpin for Suback<'a>
impl<'a> UnwindSafe for Suback<'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