Skip to main content

Lifecycle

Enum Lifecycle 

Source
#[non_exhaustive]
pub enum Lifecycle { FabricRemoved(FabricIndex), FailSafeExpired { fabric: Option<FabricIndex>, }, CommissioningComplete(FabricIndex), }
Expand description

Something that happened to the node, which every cluster holding state scoped to it has to react to.

Read, write and invoke are driven by a peer; these three are driven by the node’s own life, and every one of them is a rule the specification states once and expects every cluster to obey:

  • §11.18.6.12 — RemoveFabric “SHALL remove all associated data” of the fabric. All of it: scenes, groups, bindings, ICD registrations, OTA providers, TLS endpoints, group keys, access control entries. A cluster that keeps one entry hands it to whoever is assigned that fabric index next.
  • §11.10.7.2.2 — an expired fail-safe rolls back what the abandoned commissioner staged.
  • §11.10.7.6 — CommissioningComplete makes it permanent.

Delivered to every member of a handler tuple rather than routed by cluster id, because unlike a path this is not addressed to one cluster: it is a fact about the node that all of them are downstream of. Which is also why it is a method on ClusterHandler and not a separate trait — a device’s cluster tuple is the one place that already names every cluster it has, so the fan-out cannot be missed by forgetting to register something. The CHIP SDK registers each cluster with FabricTable::AddFabricDelegate, and its own issue tracker records what an unregistered cluster costs.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

FabricRemoved(FabricIndex)

A fabric was removed, or rolled back before it was ever complete (§11.18.6.12, §11.10.7.2.2 step 3).

Every cluster forgets everything scoped to that index. It is not “the accessing fabric”: an administrator may remove another’s, and a rollback removes one nobody was speaking on.

§

FailSafeExpired

The fail-safe expired without CommissioningComplete (§11.10.7.2.2).

A cluster that staged something reverts it. fabric is the fail-safe’s own fabric, when it had one — a fail-safe armed over PASE before AddNOC has none.

Fields

§fabric: Option<FabricIndex>

The fabric the fail-safe was armed on, if it had reached one.

§

CommissioningComplete(FabricIndex)

CommissioningComplete succeeded on fabric (§11.10.7.6).

Whatever was staged under the fail-safe is now the device’s permanent state, so the snapshot it would have been rolled back to is dropped. A cluster that never drops it reverts to that snapshot at the next expiry, however many commissionings later — which is how a device loses the network credentials it has been using for a month.

Trait Implementations§

Source§

impl Clone for Lifecycle

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 Copy for Lifecycle

Source§

impl Debug for Lifecycle

Source§

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

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

impl Eq for Lifecycle

Source§

impl PartialEq for Lifecycle

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 Lifecycle

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.