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