Struct minimq::config::ConfigBuilder
source · pub struct ConfigBuilder<'a, Broker: Broker> { /* private fields */ }
Expand description
Configuration specifying the operational state of the MQTT client.
Implementations§
source§impl<'a, Broker: Broker> ConfigBuilder<'a, Broker>
impl<'a, Broker: Broker> ConfigBuilder<'a, Broker>
sourcepub fn new(broker: Broker, buffer: &'a mut [u8]) -> Self
pub fn new(broker: Broker, buffer: &'a mut [u8]) -> Self
Construct configuration for the MQTT client.
Args
buffer
- Memory used by the MQTT client. This memory is used for the will, the message receive buffer, the transmission buffer, and the client session state.
sourcepub fn session_state(self, config: BufferConfig) -> Self
pub fn session_state(self, config: BufferConfig) -> Self
sourcepub fn rx_buffer(self, config: BufferConfig) -> Self
pub fn rx_buffer(self, config: BufferConfig) -> Self
Specify a specific configuration for the message receive buffer.
Args
config
- The configuration for the size of the receive buffer.
sourcepub fn tx_buffer(self, config: BufferConfig) -> Self
pub fn tx_buffer(self, config: BufferConfig) -> Self
Specify a specific configuration for the message transmit buffer.
Args
config
- The configuration for the size of the message transmit buffer.
sourcepub fn client_id(self, id: &str) -> Result<Self, ProtocolError>
pub fn client_id(self, id: &str) -> Result<Self, ProtocolError>
Specify a known client ID to use. If not assigned, the broker will auto assign an ID.
sourcepub fn keepalive_interval(self, seconds: u16) -> Self
pub fn keepalive_interval(self, seconds: u16) -> Self
Configure the MQTT keep-alive interval.
Note
The broker may override the requested keep-alive interval. Any value requested by the broker will be used instead.
Args
interval
- The keep-alive interval in seconds. A ping will be transmitted if no other messages are sent within 50% of the keep-alive interval.
sourcepub fn autodowngrade_qos(self) -> Self
pub fn autodowngrade_qos(self) -> Self
Specify if publication [QoS] should be automatically downgraded to the maximum supported by the server if they exceed the server [QoS] maximum.
Trait Implementations§
Auto Trait Implementations§
impl<'a, Broker> RefUnwindSafe for ConfigBuilder<'a, Broker>where
Broker: RefUnwindSafe,
impl<'a, Broker> Send for ConfigBuilder<'a, Broker>where
Broker: Send,
impl<'a, Broker> Sync for ConfigBuilder<'a, Broker>where
Broker: Sync,
impl<'a, Broker> Unpin for ConfigBuilder<'a, Broker>where
Broker: Unpin,
impl<'a, Broker> !UnwindSafe for ConfigBuilder<'a, Broker>
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