frame_core/status.rs
1//! Observable component runtime status.
2
3use serde::{Deserialize, Serialize};
4
5use crate::component::ComponentId;
6use crate::error::FailureReason;
7use crate::event::LifecycleState;
8
9/// Snapshot of one linked child process.
10#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
11pub struct ChildStatus {
12 /// Child key from its retained specification.
13 pub name: String,
14 /// Current process identifier; replacements receive fresh identifiers.
15 pub pid: u64,
16}
17
18/// Snapshot of a registered component's lifecycle and process tree.
19#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
20pub struct ComponentStatus {
21 /// Stable component identity.
22 pub id: ComponentId,
23 /// Current lifecycle state.
24 pub state: LifecycleState,
25 /// Current linked children; empty after an ordered drain.
26 pub children: Vec<ChildStatus>,
27 /// Tombstone-derived failure retained while state is Failed.
28 pub failure: Option<FailureReason>,
29}