Skip to main content

BasicInformation

Struct BasicInformation 

Source
pub struct BasicInformation<'a> {
    pub product: &'a Product<'a>,
    pub location: &'a Location,
    /* private fields */
}
Expand description

The Basic Information cluster on endpoint 0.

Holds the fixed Product record by reference and the three mutable attributes in cells, so the whole cluster is &self-usable from the interaction model without a lock.

Fields§

§product: &'a Product<'a>

The F-quality attributes.

§location: &'a Location

Location (§11.1.5.7), shared with General Commissioning.

Implementations§

Source§

impl<'a> BasicInformation<'a>

Source

pub fn new(product: &'a Product<'a>, location: &'a Location) -> Self

The cluster over a product and a location.

Source

pub fn with_local_config_disabled(self, initial: bool) -> Self

Serves LocalConfigDisabled (§11.1.5.17), starting at initial.

Absent by default: the attribute is optional, and a node that does not have an on-node user interface has nothing to disable.

Source

pub fn with_reachable(self, initial: bool) -> Self

Serves Reachable (§11.1.5.18), starting at initial.

“For a native Node this is implicitly True (and its use is optional). Its main use case is in the derived Bridged Device Basic Information cluster.”

Source

pub fn node_label(&self) -> String<32>

NodeLabel (§11.1.5.6).

Source

pub fn set_node_label(&self, label: &str) -> Result<(), Status>

Sets NodeLabel, refusing anything longer than the max 32 constraint.

Source

pub fn reachable(&self) -> Option<bool>

Reachable (§11.1.5.18), if served.

Source

pub fn set_reachable(&self, reachable: bool) -> bool

Sets Reachable, and says whether it changed — which is the trigger for the ReachableChanged event (§11.1.6.4). Does nothing if the attribute is not served.

Source

pub fn serves_local_config_disabled(&self) -> bool

Whether this instance serves LocalConfigDisabled (§11.1.5.17).

Source

pub fn serves_reachable(&self) -> bool

Whether this instance serves Reachable (§11.1.5.18).

Trait Implementations§

Source§

impl Cluster for BasicInformation<'_>

Source§

const ID: ClusterId = ID

The cluster id this implementation serves.
Source§

impl ClusterHandler for BasicInformation<'_>

Source§

fn read( &self, resolved: &Resolved<'_>, _ctx: &InteractionContext<'_>, w: &mut TlvWriter<'_>, tag: Tag, ) -> Result<(), Status>

Writes the value of resolved’s attribute under tag. Read more
Source§

fn write( &self, resolved: &Resolved<'_>, data: &[u8], _op: WriteOp, _ctx: &InteractionContext<'_>, ) -> Result<(), Status>

Writes data — the encoded TLV element, tag included — into the attribute. Read more
Source§

fn data_version(&self, _resolved: &Resolved<'_>) -> Option<u32>

The cluster instance’s data version (§7.10.3), if it tracks one. Read more
Source§

fn invoke( &self, _resolved: &ResolvedCommand<'_>, _fields: Option<&[u8]>, _ctx: &InteractionContext<'_>, _w: &mut TlvWriter<'_>, _tag: Tag, ) -> Result<Option<CommandId>, StatusIb>

Runs a command. Read more
Source§

fn on_lifecycle(&self, _event: Lifecycle)

Reacts to something that happened to the node (see Lifecycle). Read more
Source§

impl<'a> Debug for BasicInformation<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for BasicInformation<'a>

§

impl<'a> !RefUnwindSafe for BasicInformation<'a>

§

impl<'a> !Send for BasicInformation<'a>

§

impl<'a> !Sync for BasicInformation<'a>

§

impl<'a> !UnwindSafe for BasicInformation<'a>

§

impl<'a> Forget for BasicInformation<'a>

§

impl<'a> Move for BasicInformation<'a>

§

impl<'a> Unpin for BasicInformation<'a>

§

impl<'a> UnsafeUnpin for BasicInformation<'a>

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> 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, 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.