#[non_exhaustive]pub struct Identity {Show 19 fields
pub device_ids: Vec<String>,
pub roles: Vec<String>,
pub manufacturer: String,
pub model: String,
pub serial_number: String,
pub ebus_version: String,
pub device_type: Option<String>,
pub name: Option<String>,
pub fw_version: Option<String>,
pub register: Option<String>,
pub broker_ca: Option<String>,
pub auth_methods: Vec<String>,
pub hw_version: Option<String>,
pub os_version: Option<String>,
pub mac: Option<String>,
pub extra_ebus_txt: Vec<(String, String)>,
pub extra_device_info_txt: Vec<(String, String)>,
pub homie_domain: Option<String>,
pub homie_version: Option<String>,
}alloc only.Expand description
An entity’s _ebus._tcp and _device-info._tcp content (ebus.py:330-438).
One _ebus._tcp advertisement covers the whole host, so device_ids may
list several devices, joined with commas into device_id. Recommended
keys left empty are omitted. Extra keys never replace a key the identity
sets.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.device_ids: Vec<String>The host’s device ids; the first is the default instance name.
roles: Vec<String>device, controller, broker-host.
manufacturer: StringRequired.
model: StringRequired.
serial_number: StringRequired, in _device-info._tcp.
ebus_version: StringDefaults to EBUS_VERSION.
device_type: Option<String>device_type.
name: Option<String>name.
fw_version: Option<String>fw_version, in both records.
register: Option<String>register: the registration endpoint path.
broker_ca: Option<String>broker_ca: the broker CA download path.
auth_methods: Vec<String>auth_methods.
hw_version: Option<String>hw_version, in _device-info._tcp.
os_version: Option<String>os_version, in _device-info._tcp.
mac: Option<String>mac, in _device-info._tcp.
extra_ebus_txt: Vec<(String, String)>Keys the specification does not define, appended to _ebus._tcp.
extra_device_info_txt: Vec<(String, String)>Keys the specification does not define, appended to _device-info._tcp.
homie_domain: Option<String>The Homie domain the host publishes under; adds homie_domain,
homie_version and homie_roles to _ebus._tcp.
homie_version: Option<String>homie_version with homie_domain; defaults to 5.
Implementations§
Source§impl Identity
impl Identity
Sourcepub fn new<D, R>(
device_ids: impl IntoIterator<Item = D>,
roles: impl IntoIterator<Item = R>,
manufacturer: &str,
model: &str,
serial_number: &str,
) -> Self
pub fn new<D, R>( device_ids: impl IntoIterator<Item = D>, roles: impl IntoIterator<Item = R>, manufacturer: &str, model: &str, serial_number: &str, ) -> Self
An identity with the required fields; every other field empty.
Sourcepub fn check(&self) -> Result<(), TxtError>
pub fn check(&self) -> Result<(), TxtError>
Check the required fields and both records (ebus.py:371-393).
Sourcepub fn ebus_txt(&self) -> TxtRecord
pub fn ebus_txt(&self) -> TxtRecord
The _ebus._tcp record, keys in python’s order (ebus.py:400-422).
Sourcepub fn device_info_txt(&self) -> TxtRecord
pub fn device_info_txt(&self) -> TxtRecord
The _device-info._tcp record (ebus.py:424-438).