pub struct MqttConfig { /* private fields */ }Expand description
Connection settings for an MqttTransport.
Construct with MqttConfig::new and refine with the chained setters; every
field has a sensible default so only the broker address and client id are
required.
Implementations§
Source§impl MqttConfig
impl MqttConfig
Sourcepub fn new(
client_id: impl Into<String>,
host: impl Into<String>,
port: u16,
) -> Self
pub fn new( client_id: impl Into<String>, host: impl Into<String>, port: u16, ) -> Self
Creates a configuration for the given client id and broker address.
§Arguments
client_id- the MQTT client identifier presented to the broker.host- the broker hostname or IP address.port- the broker TCP port, conventionally1883for plaintext MQTT.
§Returns
A configuration with a 30-second keep-alive, a request capacity of 64, and
a default quality of service of QualityOfService::AtLeastOnce.
Sourcepub fn keep_alive(self, interval: Duration) -> Self
pub fn keep_alive(self, interval: Duration) -> Self
Trait Implementations§
Source§impl Clone for MqttConfig
impl Clone for MqttConfig
Source§fn clone(&self) -> MqttConfig
fn clone(&self) -> MqttConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MqttConfig
impl RefUnwindSafe for MqttConfig
impl Send for MqttConfig
impl Sync for MqttConfig
impl Unpin for MqttConfig
impl UnsafeUnpin for MqttConfig
impl UnwindSafe for MqttConfig
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