Struct Publish

Source
pub struct Publish<S> { /* private fields */ }
Expand description

Publish message

Implementations§

Source§

impl<S> Publish<S>

Source

pub fn dup(&self) -> bool

this might be re-delivery of an earlier attempt to send the Packet.

Source

pub fn retain(&self) -> bool

Source

pub fn qos(&self) -> QoS

the level of assurance for delivery of an Application Message.

Source

pub fn publish_topic(&self) -> &str

the information channel to which payload data is published.

Source

pub fn session(&self) -> &S

returns reference to a connection session

Source

pub fn session_mut(&mut self) -> &mut S

returns mutable reference to a connection session

Source

pub fn id(&self) -> Option<u16>

only present in PUBLISH Packets where the QoS level is 1 or 2.

Source

pub fn topic(&self) -> &Path<ByteString>

Source

pub fn topic_mut(&mut self) -> &mut Path<ByteString>

Source

pub fn query(&self) -> &str

Source

pub fn packet(&self) -> &Publish

Source

pub fn payload(&self) -> &Bytes

the Application Message that is being published.

Source

pub fn take_payload(&self) -> Bytes

Extract Bytes from packet payload

Source

pub fn sink(&self) -> &MqttSink

Mqtt client sink object

Source

pub fn json<T: DeserializeOwned>(&mut self) -> Result<T, JsonError>

Loads and parse application/json encoded body.

Trait Implementations§

Source§

impl<S> Debug for Publish<S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<S> !Freeze for Publish<S>

§

impl<S> !RefUnwindSafe for Publish<S>

§

impl<S> !Send for Publish<S>

§

impl<S> !Sync for Publish<S>

§

impl<S> Unpin for Publish<S>

§

impl<S> !UnwindSafe for Publish<S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.