pub struct PubAck { /* private fields */ }Expand description
Represents an MQTT PubAck packet
§Example
use mqute_codec::protocol::v5::{ReasonCode, PubAck};
let packet = PubAck::new(1234, ReasonCode::Success, None);
assert_eq!(packet.packet_id(), 1234u16);
assert_eq!(packet.code(), ReasonCode::Success);Implementations§
Source§impl PubAck
impl PubAck
Sourcepub fn new(
packet_id: u16,
code: ReasonCode,
properties: Option<PubAckProperties>,
) -> Self
pub fn new( packet_id: u16, code: ReasonCode, properties: Option<PubAckProperties>, ) -> Self
Creates a new PubAck packet
Sourcepub fn code(&self) -> ReasonCode
pub fn code(&self) -> ReasonCode
Returns the reason code of the PubAck packet
Sourcepub fn properties(&self) -> Option<PubAckProperties>
pub fn properties(&self) -> Option<PubAckProperties>
Returns the PubAck properties if present
Trait Implementations§
impl Eq for PubAck
impl PubAck for PubAck
impl StructuralPartialEq for PubAck
Auto Trait Implementations§
impl Freeze for PubAck
impl RefUnwindSafe for PubAck
impl Send for PubAck
impl Sync for PubAck
impl Unpin for PubAck
impl UnwindSafe for PubAck
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Encoded for Twhere
T: Encode,
impl<T> Encoded for Twhere
T: Encode,
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Calculates the total encoded length of the packet. Read more