pub struct MqttServiceConfig { /* private fields */ }Implementations§
Source§impl MqttServiceConfig
impl MqttServiceConfig
pub fn new() -> Self
Sourcepub fn protocol_version_timeout(self, timeout: Seconds) -> Self
pub fn protocol_version_timeout(self, timeout: Seconds) -> Self
Set client timeout reading protocol version.
Defines a timeout for reading protocol version. If a client does not transmit version of the protocol within this time, the connection is terminated with Mqtt::Handshake(HandshakeError::Timeout) error.
By default, timeuot is 5 seconds.
Sourcepub fn set_connect_timeout(self, timeout: Seconds) -> Self
pub fn set_connect_timeout(self, timeout: Seconds) -> Self
Set client timeout for first Connect frame.
Defines a timeout for reading Connect frame. If a client does not transmit
the entire frame within this time, the connection is terminated with
Mqtt::Handshake(HandshakeError::Timeout) error.
By default, connect timeout is disabled.
Sourcepub fn set_max_qos(self, qos: QoS) -> Self
pub fn set_max_qos(self, qos: QoS) -> Self
Set max allowed QoS.
If peer sends publish with higher qos then ProtocolError::MaxQoSViolated(..)
By default max qos is set to ExactlyOnce.
Sourcepub fn set_max_size(self, size: u32) -> Self
pub fn set_max_size(self, size: u32) -> Self
Set max inbound frame size.
If max size is set to 0, size is unlimited.
By default max size is set to 0
Sourcepub fn set_max_receive(self, val: u16) -> Self
pub fn set_max_receive(self, val: u16) -> Self
Set receive max
Number of in-flight publish packets. By default receive max is set to 15 packets. To disable timeout set value to 0.
Sourcepub fn set_max_receive_size(self, val: usize) -> Self
pub fn set_max_receive_size(self, val: usize) -> Self
Total size of received in-flight messages.
By default total in-flight size is set to 64Kb
Sourcepub fn set_max_topic_alias(self, val: u16) -> Self
pub fn set_max_topic_alias(self, val: u16) -> Self
Number of topic aliases.
By default value is set to 32
Sourcepub fn set_max_send(self, val: u16) -> Self
pub fn set_max_send(self, val: u16) -> Self
Number of outgoing concurrent messages.
By default outgoing is set to 16 messages
Sourcepub fn set_max_send_size(self, val: u32) -> Self
pub fn set_max_send_size(self, val: u32) -> Self
Total size of outgoing messages.
By default total outgoing size is set to 64Kb
Sourcepub fn set_min_chunk_size(self, size: u32) -> Self
pub fn set_min_chunk_size(self, size: u32) -> Self
Set min payload chunk size.
If the minimum size is set to 0, incoming payload chunks
will be processed immediately. Otherwise, the codec will
accumulate chunks until the total size reaches the specified minimum.
By default min size is set to 0
Sourcepub fn set_handle_qos_after_disconnect(
self,
max_handle_qos: Option<QoS>,
) -> Self
pub fn set_handle_qos_after_disconnect( self, max_handle_qos: Option<QoS>, ) -> Self
Handle max received QoS messages after client disconnect.
By default, messages received before dispatched to the publish service will be dropped if the client disconnect is detected on the server.
If this option is set to Some(QoS::AtMostOnce), only the received QoS 0 messages will
always be handled by the server’s publish service no matter if the client is disconnected
or not.
If this option is set to Some(QoS::AtLeastOnce), the received QoS 0 and QoS 1 messages
will always be handled by the server’s publish service no matter if the client
is disconnected or not. The QoS 2 messages will be dropped if the client disconnecting is
detected before the server dispatches them to the publish service.
If this option is set to Some(QoS::ExactlyOnce), all the messages received will always
be handled by the server’s publish service no matter if the client is disconnected or not.
The received messages which QoS larger than the max_handle_qos will not be guaranteed to
be handled or not after the client disconnect. It depends on the network condition.
By default handle-qos-after-disconnect is set to None
Sourcepub fn set_handshake_timeout(self, timeout: Seconds) -> Self
pub fn set_handshake_timeout(self, timeout: Seconds) -> Self
Set handshake timeout.
Handshake includes connect packet and response connect-ack.
By default handshake timeuot is disabled.
Trait Implementations§
Source§impl Clone for MqttServiceConfig
impl Clone for MqttServiceConfig
Source§fn clone(&self) -> MqttServiceConfig
fn clone(&self) -> MqttServiceConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more