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