pub struct DeviceView {
pub id: Id,
pub domain: Arc<str>,
pub state: Option<DeviceState>,
pub effective: Option<DeviceState>,
pub description: Option<Arc<DeviceDescription>>,
pub confirmed: bool,
pub synced: bool,
/* private fields */
}Available on crate feature
alloc only.Expand description
What the controller knows about one device.
Fields§
§id: IdDevice id.
domain: Arc<str>Topic domain it publishes in.
state: Option<DeviceState>Last valid $state; always Some for a device the queries return.
effective: Option<DeviceState>Effective state (convention.md:262-267): lost when its root is lost,
else its own state.
description: Option<Arc<DeviceDescription>>The applied description, None before the first valid one.
confirmed: boolHeard since the last link-up.
synced: boolEvent::DeviceSynced fired since the last description change or
link-up.
Implementations§
Source§impl DeviceView
impl DeviceView
True when other holds the very maps of properties and alerts this
view holds, as a clone does until either is changed. Constant time;
false does not prove the contents differ.
Sourcepub fn property(&self, node: &str, property: &str) -> Option<&PropertyView>
pub fn property(&self, node: &str, property: &str) -> Option<&PropertyView>
The property node/property, when the description declares it.
Sourcepub fn properties(&self) -> impl Iterator<Item = (&Id, &Id, &PropertyView)> + '_
pub fn properties(&self) -> impl Iterator<Item = (&Id, &Id, &PropertyView)> + '_
Every declared property as (node, property, view), in id order.
Trait Implementations§
Source§impl Clone for DeviceView
impl Clone for DeviceView
Auto Trait Implementations§
impl Freeze for DeviceView
impl RefUnwindSafe for DeviceView
impl Send for DeviceView
impl Sync for DeviceView
impl Unpin for DeviceView
impl UnsafeUnpin for DeviceView
impl UnwindSafe for DeviceView
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more