Struct mqtt::packet::subscribe::SubscribePacket
source · pub struct SubscribePacket { /* private fields */ }
Expand description
SUBSCRIBE
packet
Implementations§
source§impl SubscribePacket
impl SubscribePacket
pub fn new( pkid: u16, subscribes: Vec<(TopicFilter, QualityOfService)> ) -> SubscribePacket
pub fn packet_identifier(&self) -> u16
pub fn set_packet_identifier(&mut self, pkid: u16)
pub fn subscribes(&self) -> &[(TopicFilter, QualityOfService)]
Trait Implementations§
source§impl Clone for SubscribePacket
impl Clone for SubscribePacket
source§fn clone(&self) -> SubscribePacket
fn clone(&self) -> SubscribePacket
Returns a copy 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 SubscribePacket
impl Debug for SubscribePacket
source§impl DecodablePacket for SubscribePacket
impl DecodablePacket for SubscribePacket
type DecodePacketError = SubscribePacketError
source§fn decode_packet<R: Read>(
reader: &mut R,
fixed_header: FixedHeader
) -> Result<Self, PacketError<Self>>
fn decode_packet<R: Read>( reader: &mut R, fixed_header: FixedHeader ) -> Result<Self, PacketError<Self>>
Decode packet given a
FixedHeader
source§impl EncodablePacket for SubscribePacket
impl EncodablePacket for SubscribePacket
source§fn fixed_header(&self) -> &FixedHeader
fn fixed_header(&self) -> &FixedHeader
Get a reference to
FixedHeader
. All MQTT packet must have a fixed header.source§fn encode_packet<W: Write>(&self, writer: &mut W) -> Result<()>
fn encode_packet<W: Write>(&self, writer: &mut W) -> Result<()>
Encodes packet data after fixed header, including variable headers and payload
source§fn encoded_packet_length(&self) -> u32
fn encoded_packet_length(&self) -> u32
Length in bytes for data after fixed header, including variable headers and payload
source§impl From<SubscribePacket> for VariablePacket
impl From<SubscribePacket> for VariablePacket
source§fn from(pk: SubscribePacket) -> VariablePacket
fn from(pk: SubscribePacket) -> VariablePacket
Converts to this type from the input type.
source§impl PartialEq for SubscribePacket
impl PartialEq for SubscribePacket
source§fn eq(&self, other: &SubscribePacket) -> bool
fn eq(&self, other: &SubscribePacket) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for SubscribePacket
impl StructuralPartialEq for SubscribePacket
Auto Trait Implementations§
impl Freeze for SubscribePacket
impl RefUnwindSafe for SubscribePacket
impl Send for SubscribePacket
impl Sync for SubscribePacket
impl Unpin for SubscribePacket
impl UnwindSafe for SubscribePacket
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