[][src]Struct paho_mqtt::message::MessageBuilder

pub struct MessageBuilder { /* fields omitted */ }

Builder to create a new Message

Methods

impl MessageBuilder[src]

pub fn new() -> MessageBuilder[src]

Create a new message builder.

pub fn topic<T>(self, topic: T) -> MessageBuilder where
    T: Into<String>, 
[src]

Sets the topic for the message

Arguments

topic The topic on which the message should be published.

pub fn payload<V>(self, payload: V) -> MessageBuilder where
    V: Into<Vec<u8>>, 
[src]

Sets the payload for the message

Arguments

payload The binary payload of the message

pub fn qos(self, qos: i32) -> MessageBuilder[src]

Sets the Quality of Service for the message.

Arguments

qos The quality of service for the message.

pub fn retained(self, retained: bool) -> MessageBuilder[src]

Sets whether or not the published message should be retained by the broker.

Arguments

retained Set true if the message should be retained by the broker, false if not.

pub fn properties(self, props: Properties) -> MessageBuilder[src]

Sets the collection of properties for the message.

Arguments

props The collection of properties to include with the message.

pub fn finalize(self) -> Message[src]

Finalize the builder to create the message.

Trait Implementations

impl Debug for MessageBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.