pub struct Publish<Bytes> { /* private fields */ }
Expand description
An MQTT PUBLISH
packet
Implementations§
Source§impl<Bytes> Publish<Bytes>
impl<Bytes> Publish<Bytes>
Sourcepub fn new<T, P>(
topic: T,
payload: P,
retain: bool,
) -> Result<Self, MemoryError>
pub fn new<T, P>( topic: T, payload: P, retain: bool, ) -> Result<Self, MemoryError>
Creates a new packet
Sourcepub fn with_qos(self, qos: u8, packet_id: u16, dup: bool) -> Self
pub fn with_qos(self, qos: u8, packet_id: u16, dup: bool) -> Self
Configures the packet quality-of-service level and specifies whether this packet is a duplicate transmission (aka retry) or not
§QoS Levels
Valid QoS levels are:
0
: At most one delivery1
: At least one delivery2
: Exactly one delivery
Trait Implementations§
Source§impl<Bytes> IntoIterator for Publish<Bytes>
impl<Bytes> IntoIterator for Publish<Bytes>
Source§type IntoIter = Chain<Chain<Chain<Chain<Chain<Empty<u8>, Once<u8>>, Take<<[u8; 4] as IntoIterator>::IntoIter>>, Chain<<[u8; 2] as IntoIterator>::IntoIter, <Bytes as IntoIterator>::IntoIter>>, Take<<[u8; 2] as IntoIterator>::IntoIter>>, <Bytes as IntoIterator>::IntoIter>
type IntoIter = Chain<Chain<Chain<Chain<Chain<Empty<u8>, Once<u8>>, Take<<[u8; 4] as IntoIterator>::IntoIter>>, Chain<<[u8; 2] as IntoIterator>::IntoIter, <Bytes as IntoIterator>::IntoIter>>, Take<<[u8; 2] as IntoIterator>::IntoIter>>, <Bytes as IntoIterator>::IntoIter>
Which kind of iterator are we turning this into?
Source§impl<Bytes> TryFromIterator for Publish<Bytes>
impl<Bytes> TryFromIterator for Publish<Bytes>
Source§fn try_from_iter<T>(iter: T) -> Result<Self, DecoderError>where
T: IntoIterator<Item = u8>,
fn try_from_iter<T>(iter: T) -> Result<Self, DecoderError>where
T: IntoIterator<Item = u8>,
Tries to build
Self
from the given byte iteratorimpl<Bytes: Eq> Eq for Publish<Bytes>
impl<Bytes> StructuralPartialEq for Publish<Bytes>
Auto Trait Implementations§
impl<Bytes> Freeze for Publish<Bytes>where
Bytes: Freeze,
impl<Bytes> RefUnwindSafe for Publish<Bytes>where
Bytes: RefUnwindSafe,
impl<Bytes> Send for Publish<Bytes>where
Bytes: Send,
impl<Bytes> Sync for Publish<Bytes>where
Bytes: Sync,
impl<Bytes> Unpin for Publish<Bytes>where
Bytes: Unpin,
impl<Bytes> UnwindSafe for Publish<Bytes>where
Bytes: UnwindSafe,
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