Skip to main content

Graph

Struct Graph 

Source
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).

Auto Trait Implementations§

§

impl<const N: usize> !RefUnwindSafe for Graph<N>

§

impl<const N: usize> !UnwindSafe for Graph<N>

§

impl<const N: usize> Freeze for Graph<N>

§

impl<const N: usize> Send for Graph<N>

§

impl<const N: usize> Sync for Graph<N>

§

impl<const N: usize> Unpin for Graph<N>

§

impl<const N: usize> UnsafeUnpin for Graph<N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.