pub enum LifecycleOp {
Startup,
FactoryReset,
FabricRemoval {
fab_idx: NonZero<u8>,
},
}Expand description
A lifecycle operation delivered to a handler via Handler::lifecycle /
AsyncHandler::lifecycle.
Unlike read/write/invoke - which are routed to the single handler matching the operation path - lifecycle operations are broadcast to every handler in the handler chain.
Variants§
Startup
The node is starting up.
Delivered once, after the Data Model is constructed and before it starts serving operations.
The typical reaction is to populate the handler’s in-memory state from
persisted storage (HandlerContext::kv) - the mirror image of the
on-the-fly persistence the handler does while serving operations.
FactoryReset
The node is being factory-reset.
The typical reaction is to reset the handler’s in-memory state to factory
defaults and remove the handler’s persisted data from HandlerContext::kv.
FabricRemoval
The fabric with the given local index has been removed from the node.
Delivered synchronously (via HandlerContext::notify_fabric_removed)
right after the fabric is gone from the fabric table - via the
RemoveFabric command, an AddNOC rollback, or a fail-safe expiry
that did not resurrect a persisted (pre-UpdateNOC) copy of the
fabric. NOT delivered when a fail-safe expiry reverts an in-progress
UpdateNOC - the fabric is still commissioned in that case.
The typical reaction is to drop the removed fabric’s entries from any
fabric-scoped state the handler owns outside the fabric table (a
bindings registry, a scene table, provider lists, …) and re-persist.
State stored inside the Fabric object itself (ACLs, group keys)
needs no reaction - it is dropped with the fabric.
Like every lifecycle operation this is a broadcast, so multiple
handler instances borrowing one shared registry each receive it -
reactions must be idempotent (a retain-style purge naturally is).
Trait Implementations§
Source§impl Clone for LifecycleOp
impl Clone for LifecycleOp
Source§fn clone(&self) -> LifecycleOp
fn clone(&self) -> LifecycleOp
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LifecycleOp
Source§impl Debug for LifecycleOp
impl Debug for LifecycleOp
impl Eq for LifecycleOp
Source§impl Hash for LifecycleOp
impl Hash for LifecycleOp
Source§impl PartialEq for LifecycleOp
impl PartialEq for LifecycleOp
impl StructuralPartialEq for LifecycleOp
Auto Trait Implementations§
impl Freeze for LifecycleOp
impl RefUnwindSafe for LifecycleOp
impl Send for LifecycleOp
impl Sync for LifecycleOp
impl Unpin for LifecycleOp
impl UnsafeUnpin for LifecycleOp
impl UnwindSafe for LifecycleOp
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more