pub struct UnsubAckPacket {
pub packet_id: u16,
pub reason_codes: Vec<UnsubAckReasonCode>,
pub properties: Properties,
pub protocol_version: u8,
}Expand description
MQTT UNSUBACK packet
Fields§
§packet_id: u16Packet identifier
reason_codes: Vec<UnsubAckReasonCode>Reason codes for each unsubscription
properties: PropertiesUNSUBACK properties (v5.0 only)
protocol_version: u8Protocol version (4 = v3.1.1, 5 = v5.0)
Implementations§
Source§impl UnsubAckPacket
impl UnsubAckPacket
Sourcepub fn add_reason_code(self, code: UnsubAckReasonCode) -> Self
pub fn add_reason_code(self, code: UnsubAckReasonCode) -> Self
Adds a reason code
Sourcepub fn add_success(self) -> Self
pub fn add_success(self) -> Self
Adds a success reason code
Sourcepub fn with_reason_string(self, reason: String) -> Self
pub fn with_reason_string(self, reason: String) -> Self
Sets the reason string
Sourcepub fn with_user_property(self, key: String, value: String) -> Self
pub fn with_user_property(self, key: String, value: String) -> Self
Adds a user property
Trait Implementations§
Source§impl Clone for UnsubAckPacket
impl Clone for UnsubAckPacket
Source§fn clone(&self) -> UnsubAckPacket
fn clone(&self) -> UnsubAckPacket
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnsubAckPacket
impl Debug for UnsubAckPacket
Source§impl MqttPacket for UnsubAckPacket
impl MqttPacket for UnsubAckPacket
Source§fn packet_type(&self) -> PacketType
fn packet_type(&self) -> PacketType
Returns the packet type
Source§fn encode_body<B: BufMut>(&self, buf: &mut B) -> Result<()>
fn encode_body<B: BufMut>(&self, buf: &mut B) -> Result<()>
Encodes the packet body (without fixed header) Read more
Source§fn decode_body<B: Buf>(buf: &mut B, _fixed_header: &FixedHeader) -> Result<Self>
fn decode_body<B: Buf>(buf: &mut B, _fixed_header: &FixedHeader) -> Result<Self>
Decodes the packet body (without fixed header) Read more
Auto Trait Implementations§
impl Freeze for UnsubAckPacket
impl RefUnwindSafe for UnsubAckPacket
impl Send for UnsubAckPacket
impl Sync for UnsubAckPacket
impl Unpin for UnsubAckPacket
impl UnwindSafe for UnsubAckPacket
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