Struct poster::PublishOpts
source · pub struct PublishOpts<'a> { /* private fields */ }Expand description
Publish options, represented as a consuming builder. Used during publish request, translated to the PUBLISH packet.
Implementations§
source§impl<'a> PublishOpts<'a>
impl<'a> PublishOpts<'a>
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new PublishOpts instance.
sourcepub fn payload_format_indicator(self, val: bool) -> Self
pub fn payload_format_indicator(self, val: bool) -> Self
Sets payload format indicator.
Value false indicates that the will payload is in unspecified format.
Value true indicates that the payload is UTF8 encoded character data.
sourcepub fn topic_alias(self, val: u16) -> Self
pub fn topic_alias(self, val: u16) -> Self
sourcepub fn message_expiry_interval(self, val: Duration) -> Self
pub fn message_expiry_interval(self, val: Duration) -> Self
sourcepub fn correlation_data(self, val: &'a [u8]) -> Self
pub fn correlation_data(self, val: &'a [u8]) -> Self
Sets correlation data.
sourcepub fn response_topic(self, val: &'a str) -> Self
pub fn response_topic(self, val: &'a str) -> Self
Sets response topic.
sourcepub fn content_type(self, val: &'a str) -> Self
pub fn content_type(self, val: &'a str) -> Self
Sets message content type.
sourcepub fn user_property(self, (key, val): (&'a str, &'a str)) -> Self
pub fn user_property(self, (key, val): (&'a str, &'a str)) -> Self
Sets user properties as key-value pairs. Multiple user properties may be set.
Trait Implementations§
source§impl<'a> Default for PublishOpts<'a>
impl<'a> Default for PublishOpts<'a>
source§fn default() -> PublishOpts<'a>
fn default() -> PublishOpts<'a>
Returns the “default value” for a type. Read more