Struct Ack
pub struct Ack<'a> {
pub packet_id: PacketId,
pub reason_code: ReasonCode,
pub properties: &'a AckProperties,
}Expand description
Acknowledgement packet (PUBACK, PUBREC, PUBREL, PUBCOMP).
Fields§
§packet_id: PacketIdPacket identifier being acknowledged.
reason_code: ReasonCodeReason code for the acknowledgement.
properties: &'a AckPropertiesProperties (Reason String, User Property).
Implementations§
§impl<'a> Ack<'a>
impl<'a> Ack<'a>
pub const fn encoded_len(&self) -> usize
pub const fn encoded_len(&self) -> usize
Returns the encoded size of this acknowledgement packet in bytes.
pub const fn encode(&self, w: &mut Writer<'_>) -> Result<(), EncodeError>
pub const fn encode(&self, w: &mut Writer<'_>) -> Result<(), EncodeError>
Encodes this acknowledgement 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 acknowledgement from the reader.
§Errors
Returns DecodeError if the data is malformed or contains an invalid
packet identifier, reason code, or disallowed properties.
Trait Implementations§
impl<'a> Copy for Ack<'a>
impl<'a> Eq for Ack<'a>
impl<'a> StructuralPartialEq for Ack<'a>
Auto Trait Implementations§
impl<'a> Freeze for Ack<'a>
impl<'a> RefUnwindSafe for Ack<'a>
impl<'a> Send for Ack<'a>
impl<'a> Sync for Ack<'a>
impl<'a> Unpin for Ack<'a>
impl<'a> UnwindSafe for Ack<'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