Skip to main content

Config

Struct Config 

Source
#[non_exhaustive]
pub struct Config {
Show 14 fields pub domain: Domain, pub discovery: Discovery, pub subscribe_qos: QoS, pub pacing: Option<Pacing>, pub stuck_timeout_ms: Option<u64>, pub max_resubscribe_attempts: u8, pub absent_after_ms: u64, pub sync_timeout_ms: u64, pub trust_session: bool, pub link_up_discards_queued: bool, pub max_early_values: usize, pub max_alerts: usize, pub max_devices: Option<usize>, pub host_filters: Vec<String>,
}
Available on crate feature alloc only.
Expand description

Controller configuration. Start from Config::wildcard, Config::tree or Config::device and adjust the fields.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§domain: Domain

Topic domain; Domain::Named "ebus" by default.

§discovery: Discovery

Discovery mode.

§subscribe_qos: QoS

QoS of every subscription; ExactlyOnce by default (convention.md:45).

§pacing: Option<Pacing>

Subscription pacing; None subscribes every device’s property filters with its $description.

§stuck_timeout_ms: Option<u64>

Milliseconds a device may wait for its retained messages before it is resubscribed; None disables stuck healing. 10 000 by default.

§max_resubscribe_attempts: u8

Resubscribe attempts before a stuck device is given up; 3 by default.

§absent_after_ms: u64

Milliseconds after a link-up within which a known device must be heard again, or Event::DeviceAbsent fires; 30 000 by default.

§sync_timeout_ms: u64

Milliseconds after a description is applied, or after a link-up, before Event::DeviceSynced reports missing values; 10 000 by default.

§trust_session: bool

Trust a CONNACK with session_present: true and keep every subscription; false (the default) re-paces as after a clean session.

§link_up_discards_queued: bool

The host never sends, after a Link::Up { session_present: false }, a SUBSCRIBE the controller queued before handling it. Replay matching then restarts at each clean link-up, so a replay lost with a connection delays no later re-sync; false (the default) keeps the unmatched SUBSCRIBEs across it.

§max_early_values: usize

Values buffered per device before its $description arrives; 1024 by default.

§max_alerts: usize

Alerts held per device; a new alert id past it is dropped. 256 by default.

§max_devices: Option<usize>

Most devices tracked at once; None (the default) is unbounded.

§host_filters: Vec<String>

Filters the host subscribes on the same client. The controller never unsubscribes them.

Implementations§

Source§

impl Config

Source

pub fn wildcard() -> Self

Wildcard discovery in the ebus domain, with every default.

Source

pub fn tree(root: &str) -> Result<Self, ConfigError>

Tree discovery from root, otherwise as Config::wildcard.

Source

pub fn device(id: &str) -> Result<Self, ConfigError>

Single-device discovery of id, otherwise as Config::wildcard.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

impl Eq for Config

Source§

impl PartialEq for Config

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Config

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> 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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.