#[non_exhaustive]pub enum LifecycleEvent {
Installed,
NodeStarted {
down_since_ms: Option<u64>,
},
}Expand description
A lifecycle event, delivered as
InboundDelegateMsg::Lifecycle.
Only sent to a delegate whose manifest lists the matching
LifecycleKind. A node that implements delivery also requires the user’s
Capability::Background grant for the delegate’s app. The run gets the
delegate’s registered parameters and no origin.
§Wire format
bincode, nested inside InboundDelegateMsg. Variants are appended, never
inserted or reordered (pinned by lifecycle_event_tags_are_pinned). A
variant’s fields are frozen once released: WIRE-FORMAT.md rule 1 forbids
appending a field to a struct already on the wire, so new information
arrives as a new variant.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Installed
This delegate was installed on this node: its first registration here,
or the first time its app was granted Capability::Background after
that. Delivered at most once per delegate key per node.
A delegate typically uses it to subscribe to the contracts it watches and to do any one-time setup.
NodeStarted
The node started. Delivered once per node start, after the node has finished whatever restore work it does at start-up.
Contract notifications that arrived while the node was down were not delivered and are never replayed, so a delegate should re-read any contract it depends on rather than assume it saw every change.
Implementations§
Source§impl LifecycleEvent
impl LifecycleEvent
Sourcepub fn kind(&self) -> LifecycleKind
pub fn kind(&self) -> LifecycleKind
The manifest kind that must be listed for this event to be delivered.