Struct poster::ConnectOpts
source · pub struct ConnectOpts<'a> { /* private fields */ }Expand description
Connection options, represented as a consuming builder. Used during connection request, translated to the CONNECT packet.
Implementations§
source§impl<'a> ConnectOpts<'a>
impl<'a> ConnectOpts<'a>
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new ConnectOpts instance.
sourcepub fn client_identifier(self, val: &'a str) -> Self
pub fn client_identifier(self, val: &'a str) -> Self
Sets the client identifier.
sourcepub fn keep_alive(self, val: Duration) -> Self
pub fn keep_alive(self, val: Duration) -> Self
sourcepub fn session_expiry_interval(self, val: Duration) -> Self
pub fn session_expiry_interval(self, val: Duration) -> Self
sourcepub fn receive_maximum(self, val: u16) -> Self
pub fn receive_maximum(self, val: u16) -> Self
sourcepub fn maximum_packet_size(self, val: u32) -> Self
pub fn maximum_packet_size(self, val: u32) -> Self
sourcepub fn topic_alias_maximum(self, val: u16) -> Self
pub fn topic_alias_maximum(self, val: u16) -> Self
Sets the maximum accepted value of topic alias.
sourcepub fn request_response_information(self, val: bool) -> Self
pub fn request_response_information(self, val: bool) -> Self
Requests the broker to return response information in ConnectRsp.
sourcepub fn request_problem_information(self, val: bool) -> Self
pub fn request_problem_information(self, val: bool) -> Self
Requests the broker to return additional diagnostic data (reason string, user properties) in ConnectRsp.
sourcepub fn authentication_method(self, val: &'a str) -> Self
pub fn authentication_method(self, val: &'a str) -> Self
Sets the name of the authentication method used for extended authorization.
sourcepub fn authentication_data(self, val: &'a [u8]) -> Self
pub fn authentication_data(self, val: &'a [u8]) -> Self
Sets the binary authentication data. Note that setting authentication data without authentication_method set will result in an error.
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.
sourcepub fn will_retain(self, val: bool) -> Self
pub fn will_retain(self, val: bool) -> Self
Retain for will messages.
sourcepub fn clean_start(self, val: bool) -> Self
pub fn clean_start(self, val: bool) -> Self
Clears the session upon connection.
sourcepub fn will_delay_interval(self, val: Duration) -> Self
pub fn will_delay_interval(self, val: Duration) -> Self
sourcepub fn will_payload_format_indicator(self, val: bool) -> Self
pub fn will_payload_format_indicator(self, val: bool) -> Self
Sets payload format indicator for will messages.
Value false indicates that the will payload is in unspecified format.
Value true indicates that the payload is UTF8 encoded character data.
sourcepub fn will_message_expiry_interval(self, val: Duration) -> Self
pub fn will_message_expiry_interval(self, val: Duration) -> Self
sourcepub fn will_content_type(self, val: &'a str) -> Self
pub fn will_content_type(self, val: &'a str) -> Self
Sets the content type of will messages.
sourcepub fn will_response_topic(self, val: &'a str) -> Self
pub fn will_response_topic(self, val: &'a str) -> Self
Sets the response topic for will messages.
sourcepub fn will_correlation_data(self, val: &'a [u8]) -> Self
pub fn will_correlation_data(self, val: &'a [u8]) -> Self
Sets the correlation data for will messages.
sourcepub fn will_user_property(self, (key, val): (&'a str, &'a str)) -> Self
pub fn will_user_property(self, (key, val): (&'a str, &'a str)) -> Self
Sets user properties for will messages as key-value pairs. Multiple user properties may be set.
sourcepub fn will_topic(self, val: &'a str) -> Self
pub fn will_topic(self, val: &'a str) -> Self
Sets the topic for will messages.
sourcepub fn will_payload(self, val: &'a [u8]) -> Self
pub fn will_payload(self, val: &'a [u8]) -> Self
Sets the binary payload for will messages.