Struct ReceivedPublish
pub struct ReceivedPublish<'a> {
delivery: Delivery,
retain: bool,
destination: Destination<'a>,
properties: &'a ReceivedPublishProperties,
payload: &'a Payload,
}Expand description
A decoded PUBLISH.
The properties are the bytes from the wire, so they contain the Topic
Alias if destination has one. Only
decode creates a ReceivedPublish, which keeps the two
consistent. Encoding writes the wire form back unchanged. Build a
Publish to send a new PUBLISH.
Fields§
§delivery: Delivery§retain: bool§destination: Destination<'a>§properties: &'a ReceivedPublishProperties§payload: &'a PayloadImplementations§
§impl<'a> ReceivedPublish<'a>
impl<'a> ReceivedPublish<'a>
pub fn decode(flags: u8, r: &mut Reader<'a>) -> Result<Self, DecodeError>
pub fn decode(flags: u8, r: &mut Reader<'a>) -> Result<Self, DecodeError>
Decodes a PUBLISH from its fixed-header flags and body.
§Errors
Returns DecodeError if the data is malformed, the QoS or packet
identifier is invalid, the properties contain disallowed IDs, or the
PUBLISH has neither a topic name nor a topic alias.
pub const fn destination(&self) -> Destination<'a>
pub const fn destination(&self) -> Destination<'a>
Returns the topic name, topic alias, or both.
pub const fn properties(&self) -> &'a ReceivedPublishProperties
pub const fn properties(&self) -> &'a ReceivedPublishProperties
Returns the properties as received, including any Topic Alias.
pub const fn flags_byte(&self) -> u8
pub const fn flags_byte(&self) -> u8
Returns the fixed-header flags byte for this PUBLISH.
Trait Implementations§
§impl<'a> Clone for ReceivedPublish<'a>
impl<'a> Clone for ReceivedPublish<'a>
§fn clone(&self) -> ReceivedPublish<'a>
fn clone(&self) -> ReceivedPublish<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl<'a> Debug for ReceivedPublish<'a>
impl<'a> Debug for ReceivedPublish<'a>
§impl Encode for ReceivedPublish<'_>
impl Encode for ReceivedPublish<'_>
impl<'a> Eq for ReceivedPublish<'a>
§impl<'a> PartialEq for ReceivedPublish<'a>
impl<'a> PartialEq for ReceivedPublish<'a>
impl<'a> StructuralPartialEq for ReceivedPublish<'a>
Auto Trait Implementations§
impl<'a> Freeze for ReceivedPublish<'a>
impl<'a> RefUnwindSafe for ReceivedPublish<'a>
impl<'a> Send for ReceivedPublish<'a>
impl<'a> Sync for ReceivedPublish<'a>
impl<'a> Unpin for ReceivedPublish<'a>
impl<'a> UnsafeUnpin for ReceivedPublish<'a>
impl<'a> UnwindSafe for ReceivedPublish<'a>
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