azure_iot_operations_mqtt

Struct MqttConnectionSettingsBuilder

Source
pub struct MqttConnectionSettingsBuilder { /* private fields */ }
Expand description

Implementations§

Source§

impl MqttConnectionSettingsBuilder

Source

pub fn client_id<VALUE: Into<String>>(self, value: VALUE) -> Self

Client identifier

Source

pub fn hostname<VALUE: Into<String>>(self, value: VALUE) -> Self

FQDN of the host to connect to

Source

pub fn tcp_port<VALUE: Into<u16>>(self, value: VALUE) -> Self

TCP port to connect to the host on

Source

pub fn keep_alive<VALUE: Into<Duration>>(self, value: VALUE) -> Self

Max time between communications

Source

pub fn receive_max<VALUE: Into<u16>>(self, value: VALUE) -> Self

Max number of in-flight Quality of Service 1 and 2 messages

Source

pub fn receive_packet_size_max<VALUE: Into<Option<u32>>>( self, value: VALUE, ) -> Self

Max size of a received packet

Source

pub fn session_expiry<VALUE: Into<Duration>>(self, value: VALUE) -> Self

Session Expiry Interval

Source

pub fn connection_timeout<VALUE: Into<Duration>>(self, value: VALUE) -> Self

Connection timeout

Source

pub fn clean_start<VALUE: Into<bool>>(self, value: VALUE) -> Self

Clean start

Source

pub fn username<VALUE: Into<Option<String>>>(self, value: VALUE) -> Self

Username for MQTT

Source

pub fn password<VALUE: Into<Option<String>>>(self, value: VALUE) -> Self

Password for MQTT

Source

pub fn password_file<VALUE: Into<Option<String>>>(self, value: VALUE) -> Self

Path to a file containing the MQTT password

Source

pub fn use_tls<VALUE: Into<bool>>(self, value: VALUE) -> Self

TLS negotiation enabled

Source

pub fn ca_file<VALUE: Into<Option<String>>>(self, value: VALUE) -> Self

Path to a PEM file used to validate server identity

Source

pub fn cert_file<VALUE: Into<Option<String>>>(self, value: VALUE) -> Self

Path to PEM file used to establish X509 client authentication

Source

pub fn key_file<VALUE: Into<Option<String>>>(self, value: VALUE) -> Self

Path to a file containing a key used to establish X509 client authentication

Source

pub fn key_password_file<VALUE: Into<Option<String>>>( self, value: VALUE, ) -> Self

Path to a file containing the password used to decrypt the Key

Source

pub fn sat_file<VALUE: Into<Option<String>>>(self, value: VALUE) -> Self

Path to a SAT file to be used for SAT auth

Source

pub fn build( self, ) -> Result<MqttConnectionSettings, MqttConnectionSettingsBuilderError>

Builds a new MqttConnectionSettings.

§Errors

If a required field has not been initialized.

Source§

impl MqttConnectionSettingsBuilder

Source

pub fn from_environment() -> Result<Self, String>

Initialize the MqttConnectionSettingsBuilder from environment variables.

Values that are not present in the environment will be set to defaults (including those that are not possible to be provided by the AIO environment variables).

Example

let connection_settings = MqttConnectionSettingsBuilder::from_environment().unwrap().build()?;
§Errors

Returns a String describing the error if any of the environment variables contain invalid data.

Trait Implementations§

Source§

impl Default for MqttConnectionSettingsBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V