pub struct Graph<const N: usize> {
pub nodes: &'static [Option<&'static TaskNode>; N],
pub deps: &'static [&'static [u8]; N],
pub order: [u8; N],
pub pools: &'static [&'static dyn Pool],
}Expand description
The compile-time task graph produced by supervisor_graph!: the node slots,
the dependency-index table, the topological order, and the elastic pools — the
single value Supervisor::new consumes. The macro emits one pub static GRAPH
of this type. The fields are public so the application can read them directly
(e.g. a status endpoint iterating GRAPH.nodes / GRAPH.deps).
N is capped at 256 (graph indices are u8); the macro enforces this at
expansion time.
Fields§
§nodes: &'static [Option<&'static TaskNode>; N]Node slots, one per declared node. None marks a #[cfg]-ed-out node.
deps: &'static [&'static [u8]; N]Per-node dependency indices into nodes (deps[i] lists node i’s deps).
order: [u8; N]Topologically sorted indices into nodes (dependencies before dependents;
reverse iteration is the teardown order). A dependency cycle is a compile error.
pools: &'static [&'static dyn Pool]Elastic worker pools to register with the supervisor (empty when unused).