pub struct ClientConfig<'a, const MAX_PROPERTIES: usize, T: RngCore> {
Show 15 fields pub max_subscribe_qos: QualityOfService, pub keep_alive: u16, pub username_flag: bool, pub username: EncodedString<'a>, pub password_flag: bool, pub password: BinaryData<'a>, pub properties: Vec<Property<'a>, MAX_PROPERTIES>, pub max_packet_size: u32, pub mqtt_version: MqttVersion, pub rng: T, pub will_flag: bool, pub will_topic: EncodedString<'a>, pub will_payload: BinaryData<'a>, pub will_retain: bool, pub client_id: EncodedString<'a>,
}
Expand description

Client config is main configuration for the MQTTClient structure. All of the properties are optional if they are not set they are not gonna be used. Configuration contains also MQTTv5 properties. Generic constant MAX_PROPERTIES sets the length for the properties Vec. User can insert all the properties and client will automatically use variables that are usable for the specific packet types. mqtt_version sets the version of the MQTT protocol that is gonna be used. Config also expects the rng implementation. This implementation is used for generating packet identifiers. There is counting rng implementation in the utils module that can be used. Examples of the configurations can be found in the integration tests.

Fields§

§max_subscribe_qos: QualityOfService§keep_alive: u16§username_flag: bool§username: EncodedString<'a>§password_flag: bool§password: BinaryData<'a>§properties: Vec<Property<'a>, MAX_PROPERTIES>§max_packet_size: u32§mqtt_version: MqttVersion§rng: T§will_flag: bool§will_topic: EncodedString<'a>§will_payload: BinaryData<'a>§will_retain: bool§client_id: EncodedString<'a>

Implementations§

Method adds the username array and also sets the username flag so client will use it for the authentication

Method adds the password array and also sets the password flag so client will use it for the authentication

Method adds the property to the properties Vec if there is still space. Otherwise do nothing.

Method encode the max_packet_size attribute as property to the properties Vec.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.