Struct mqtt::packet::publish::PublishPacket
source · pub struct PublishPacket { /* private fields */ }
Expand description
PUBLISH
packet
Implementations§
source§impl PublishPacket
impl PublishPacket
pub fn new<P: Into<Vec<u8>>>( topic_name: TopicName, qos: QoSWithPacketIdentifier, payload: P ) -> PublishPacket
pub fn set_dup(&mut self, dup: bool)
pub fn dup(&self) -> bool
pub fn set_qos(&mut self, qos: QoSWithPacketIdentifier)
pub fn qos(&self) -> QoSWithPacketIdentifier
pub fn set_retain(&mut self, ret: bool)
pub fn retain(&self) -> bool
pub fn set_topic_name(&mut self, topic_name: TopicName)
pub fn topic_name(&self) -> &str
pub fn payload(&self) -> &[u8] ⓘ
pub fn set_payload<P: Into<Vec<u8>>>(&mut self, payload: P)
Trait Implementations§
source§impl Clone for PublishPacket
impl Clone for PublishPacket
source§fn clone(&self) -> PublishPacket
fn clone(&self) -> PublishPacket
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 PublishPacket
impl Debug for PublishPacket
source§impl DecodablePacket for PublishPacket
impl DecodablePacket for PublishPacket
type DecodePacketError = Infallible
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 PublishPacket
impl EncodablePacket for PublishPacket
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<PublishPacket> for VariablePacket
impl From<PublishPacket> for VariablePacket
source§fn from(pk: PublishPacket) -> VariablePacket
fn from(pk: PublishPacket) -> VariablePacket
Converts to this type from the input type.
source§impl PartialEq for PublishPacket
impl PartialEq for PublishPacket
source§fn eq(&self, other: &PublishPacket) -> bool
fn eq(&self, other: &PublishPacket) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for PublishPacket
impl StructuralPartialEq for PublishPacket
Auto Trait Implementations§
impl Freeze for PublishPacket
impl RefUnwindSafe for PublishPacket
impl Send for PublishPacket
impl Sync for PublishPacket
impl Unpin for PublishPacket
impl UnwindSafe for PublishPacket
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