Struct MessageBuilder
pub struct MessageBuilder {
topic: String,
payload: Vec<u8>,
qos: QoS,
retained: bool,
props: Properties,
}Expand description
Builder to create a new Message
Fields§
§topic: String§payload: Vec<u8>§qos: QoS§retained: bool§props: PropertiesImplementations§
§impl MessageBuilder
impl MessageBuilder
pub fn new() -> MessageBuilder
pub fn new() -> MessageBuilder
Create a new message builder.
pub fn topic<T>(self, topic: T) -> MessageBuilder
pub fn topic<T>(self, topic: T) -> MessageBuilder
pub fn payload<V>(self, payload: V) -> MessageBuilder
pub fn payload<V>(self, payload: V) -> MessageBuilder
pub fn qos<Q>(self, qos: Q) -> MessageBuilderwhere
Q: Into<QoS>,
pub fn qos<Q>(self, qos: Q) -> MessageBuilderwhere
Q: Into<QoS>,
pub fn retained(self, retained: bool) -> MessageBuilder
pub fn retained(self, retained: bool) -> MessageBuilder
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
pub fn properties(self, props: Properties) -> MessageBuilder
Sets the collection of properties for the message.
§Arguments
props The collection of properties to include with the message.
Trait Implementations§
§impl Debug for MessageBuilder
impl Debug for MessageBuilder
§impl Default for MessageBuilder
impl Default for MessageBuilder
§fn default() -> MessageBuilder
fn default() -> MessageBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MessageBuilder
impl RefUnwindSafe for MessageBuilder
impl Send for MessageBuilder
impl !Sync for MessageBuilder
impl Unpin for MessageBuilder
impl UnwindSafe for MessageBuilder
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