Skip to main content

Identify

Struct Identify 

Source
pub struct Identify<'a, H: IdentifyHooks> { /* private fields */ }
Expand description

Identify, with the device’s hooks.

Implementations§

Source§

impl<'a, H: IdentifyHooks> Identify<'a, H>

Source

pub const WITH_TRIGGER_EFFECT: Optional<'static>

Everything §1.2.6 leaves to the product: TriggerEffect.

Source

pub const fn new(hooks: &'a H, kind: IdentifyTypeEnum) -> Self

A cluster over hooks, presenting itself the way kind says.

§1.2.5.2: “The value None SHALL NOT be used if the device is capable of presenting its identification state using one of the other methods” — a device that can flash a light and says None has told a commissioner not to bother asking, which is the opposite of what the cluster is for.

Source

pub fn conforming(optional: &Optional<'_>) -> Result<Conforming<2, 2, 0, 0>>

The descriptor for an instance, derived from the specification’s own tables.

Source

pub fn remaining(&self) -> u16

IdentifyTime — seconds remaining.

Source

pub fn is_identifying(&self) -> bool

Whether the endpoint is identifying itself.

Source

pub const fn kind(&self) -> IdentifyTypeEnum

How this endpoint presents itself.

Source

pub fn set_time(&self, seconds: u16, now: Instant)

Sets IdentifyTime, starting or stopping the state (§1.2.5.1).

The one place the hook is called, so a write from a client and an Identify command cannot behave differently — which they would if each did its own bookkeeping.

Source

pub fn wake_at(&self) -> Option<Instant>

When Identify::poll next has something to do.

Source

pub fn poll(&self, now: Instant)

Runs §1.2.5.1’s one-second countdown.

Catches up on elapsed time rather than counting calls, so a device that polls late — or was asleep — stops identifying when it said it would rather than however many wake-ups later.

Trait Implementations§

Source§

impl<H: IdentifyHooks> Cluster for Identify<'_, H>

So a tuple of clusters can dispatch to it by id.

Source§

const ID: ClusterId = ID

The cluster id this implementation serves.
Source§

impl<H: IdentifyHooks> ClusterHandler for Identify<'_, H>

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 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 data_version(&self, _resolved: &Resolved<'_>) -> Option<u32>

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

fn on_lifecycle(&self, _event: Lifecycle)

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

impl<'a, H: Debug + IdentifyHooks> Debug for Identify<'a, H>

Source§

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

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

impl<H: IdentifyHooks> Identifying for Identify<'_, H>

§1.3.7.6’s AddGroupIfIdentifying asks the endpoint whether it is identifying; this is the answer when the endpoint has an Identify cluster.

Source§

fn is_identifying(&self) -> bool

Whether the endpoint is identifying itself right now.

Auto Trait Implementations§

§

impl<'a, H> !Freeze for Identify<'a, H>

§

impl<'a, H> !RefUnwindSafe for Identify<'a, H>

§

impl<'a, H> !Sync for Identify<'a, H>

§

impl<'a, H> Forget for Identify<'a, H>

§

impl<'a, H> Move for Identify<'a, H>

§

impl<'a, H> Send for Identify<'a, H>
where &'a H: Send,

§

impl<'a, H> Unpin for Identify<'a, H>
where &'a H: Unpin,

§

impl<'a, H> UnsafeUnpin for Identify<'a, H>

§

impl<'a, H> UnwindSafe for Identify<'a, H>

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.