frame-core 0.2.0

Component model, lifecycle, process isolation, and WASM module host
Documentation
//! Observable component runtime status.

use serde::{Deserialize, Serialize};

use crate::component::ComponentId;
use crate::error::FailureReason;
use crate::event::LifecycleState;

/// Snapshot of one linked child process.
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub struct ChildStatus {
    /// Child key from its retained specification.
    pub name: String,
    /// Current process identifier; replacements receive fresh identifiers.
    pub pid: u64,
}

/// Snapshot of a registered component's lifecycle and process tree.
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub struct ComponentStatus {
    /// Stable component identity.
    pub id: ComponentId,
    /// Current lifecycle state.
    pub state: LifecycleState,
    /// Current linked children; empty after an ordered drain.
    pub children: Vec<ChildStatus>,
    /// Tombstone-derived failure retained while state is Failed.
    pub failure: Option<FailureReason>,
}