Config

Struct Config 

Source
pub struct Config {
Show 13 fields pub mqtt_listener: bool, pub mqtt_port: u16, pub mqtt_max_packet_size: u32, pub mqtt_sock_read_timeout: Option<u32>, pub mqtt_sock_write_timeout: Option<u32>, pub mqtt_connect_timeout: u32, pub mqtt_keep_alive: Option<u16>, pub mqtt_keep_alive_factor: F32, pub mqtt_session_expiry_interval: Option<u32>, pub mqtt_maximum_qos: u8, pub mqtt_receive_maximum: u16, pub mqtt_retain_available: bool, pub mqtt_topic_alias_max: Option<u16>,
}
Expand description

Configuration for MQTT-V5 protocol.

Fields§

§mqtt_listener: bool

Spawn MQTT listener, listening on Config::mqtt_port.

§mqtt_port: u16

MQTT network port for each node in this cluster. Once the cluster is spawned it will listen on all the available interfaces using this port.

§mqtt_max_packet_size: u32

Maximum packet size allowed by the broker, this shall be communicated with remote client during handshake.

§mqtt_sock_read_timeout: Option<u32>

Read timeout on MQTT socket, in seconds. For every new packet this timeout will kick in, and within the timeout period if a new packet is not completely read, connection will be closed.

  • Default: None,
  • Mutable: No
§mqtt_sock_write_timeout: Option<u32>

Write timeout on MQTT socket, in seconds. For every new packet this timeout will kick in, and within the timeout period if a new packet is not completely written, connection will be closed.

  • Default: None,
  • Mutable: No
§mqtt_connect_timeout: u32

Connect handshake timeout on MQTT socket, in seconds. For every new connection, this timer will kick in, and within the timeout period if connect/ack handshake is not complete, connection will be closed.

§mqtt_keep_alive: Option<u16>

Keep Alive, in secs, that broker can suggest to the client. If configured with non-zero value, clients should use this keep-alive instead of the client configured keep-alive-timeout.

  • Default: None,
  • Mutable: No
§mqtt_keep_alive_factor: F32

Keep Alive factor, the final value of mqtt_keep_alive is computed by multiplying the mqtt_keep_alive value with this factor.

§mqtt_session_expiry_interval: Option<u32>

MQTT session_expiry_interval on the broker side. If session_expiry_interval is ZERO or None, then session_expiry_interval from CONNECT packet is used. CONNECT has no session_expiry_interval interval or it is ZERO, then session ends immediately at connection close.

  • Default: None,
  • Mutable: No
§mqtt_maximum_qos: u8

MQTT mqtt_maximum_qos on the broker side. This is the advertised maximum supported QoS level by the broker.

§mqtt_receive_maximum: u16

MQTT Receive-maximum, control the number of unacknowledged PUBLISH packets server can receive and process concurrently for the client.

§mqtt_retain_available: bool

MQTT retain available and supported by broker. Disabling this would disable retain-messages on the borker side.

§mqtt_topic_alias_max: Option<u16>

MQTT Maximum value for topic_alias allowed. Specifying a value of N would mean broker can handle N-1 aliases for topic-name. Setting this value to ZERO is same as specifying None, that is, broker won’t accept any topic-aliases.

Implementations§

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Config

Source§

fn default() -> Config

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

impl From<Config> for Protocol

Source§

fn from(config: Config) -> Protocol

Converts to this type from the input type.
Source§

impl PartialEq for Config

Source§

fn eq(&self, other: &Config) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<Value> for Config

Source§

type Error = Error

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

fn try_from(val: Value) -> Result<Config>

Performs the conversion.
Source§

impl Eq for Config

Source§

impl StructuralPartialEq for Config

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.