pub struct Graph { /* private fields */ }Expand description
A single-thread graph/concurrency-domain product surface (D22/B53).
Implementations§
Source§impl Graph
impl Graph
Sourcepub fn checkpoint(&self) -> GraphRestoreResult<GraphCheckpoint>
pub fn checkpoint(&self) -> GraphRestoreResult<GraphCheckpoint>
Updates or reads checkpoint.
Source§impl Graph
impl Graph
Sourcepub fn new(opts: GraphOptions) -> Self
pub fn new(opts: GraphOptions) -> Self
Creates or computes new.
Sourcepub fn topology_group(&self) -> TopologyGroup
pub fn topology_group(&self) -> TopologyGroup
D152 graph-owned topology/release group. Members are ordinary registered graph nodes and release is quiescent-only; no protocol messages are synthesized.
Sourcepub fn topology_group_opts(&self, opts: TopologyGroupOptions) -> TopologyGroup
pub fn topology_group_opts(&self, opts: TopologyGroupOptions) -> TopologyGroup
Updates or reads topology_group_opts.
Sourcepub fn find(&self, id: &str) -> Option<GraphNode>
pub fn find(&self, id: &str) -> Option<GraphNode>
Look up a registered graph node by stable id.
Sourcepub fn node<T: 'static, F: Fn(&Ctx) + 'static>(
&self,
deps: Vec<Core>,
f: F,
) -> Node<T>
pub fn node<T: 'static, F: Fn(&Ctx) + 'static>( &self, deps: Vec<Core>, f: F, ) -> Node<T>
ctx-level power surface: the raw (ctx)=>void node factory.
Sourcepub fn node_opts<T: 'static, F: Fn(&Ctx) + 'static>(
&self,
deps: Vec<Core>,
f: F,
opts: GraphNodeOpts,
) -> Node<T>
pub fn node_opts<T: 'static, F: Fn(&Ctx) + 'static>( &self, deps: Vec<Core>, f: F, opts: GraphNodeOpts, ) -> Node<T>
Updates or reads node_opts.
Sourcepub fn state<T: 'static>(&self, initial: T) -> Node<T>
pub fn state<T: 'static>(&self, initial: T) -> Node<T>
Graph-owned state node with an initial value.
Sourcepub fn state_opts<T: 'static>(&self, initial: T, opts: GraphNodeOpts) -> Node<T>
pub fn state_opts<T: 'static>(&self, initial: T, opts: GraphNodeOpts) -> Node<T>
Updates or reads state_opts.
Sourcepub fn state_empty<T: 'static>(&self) -> Node<T>
pub fn state_empty<T: 'static>(&self) -> Node<T>
Graph-owned SENTINEL state node.
Sourcepub fn state_empty_opts<T: 'static>(&self, opts: GraphNodeOpts) -> Node<T>
pub fn state_empty_opts<T: 'static>(&self, opts: GraphNodeOpts) -> Node<T>
Updates or reads state_empty_opts.
Sourcepub fn producer<T: 'static, F: Fn(&Ctx) + 'static>(&self, f: F) -> Node<T>
pub fn producer<T: 'static, F: Fn(&Ctx) + 'static>(&self, f: F) -> Node<T>
ctx-level depless source; runs once on activation.
Sourcepub fn producer_opts<T: 'static, F: Fn(&Ctx) + 'static>(
&self,
f: F,
opts: GraphNodeOpts,
) -> Node<T>
pub fn producer_opts<T: 'static, F: Fn(&Ctx) + 'static>( &self, f: F, opts: GraphNodeOpts, ) -> Node<T>
Updates or reads producer_opts.
Sourcepub fn derived<T: 'static, F: Fn(&Values<'_>) -> Option<T> + 'static>(
&self,
deps: Vec<Core>,
f: F,
) -> Node<T>
pub fn derived<T: 'static, F: Fn(&Values<'_>) -> Option<T> + 'static>( &self, deps: Vec<Core>, f: F, ) -> Node<T>
Value-level derived sugar: return Some(value) to emit DATA, None for
a no-emit/RESOLVED settle. Reads dep values through Values, not raw Ctx.
Sourcepub fn derived_opts<T: 'static, F: Fn(&Values<'_>) -> Option<T> + 'static>(
&self,
deps: Vec<Core>,
f: F,
opts: GraphNodeOpts,
) -> Node<T>
pub fn derived_opts<T: 'static, F: Fn(&Values<'_>) -> Option<T> + 'static>( &self, deps: Vec<Core>, f: F, opts: GraphNodeOpts, ) -> Node<T>
Updates or reads derived_opts.
Sourcepub fn effect<F: Fn(&Values<'_>) -> Option<Box<dyn FnOnce()>> + 'static>(
&self,
deps: Vec<Core>,
f: F,
) -> Node<()>
pub fn effect<F: Fn(&Values<'_>) -> Option<Box<dyn FnOnce()>> + 'static>( &self, deps: Vec<Core>, f: F, ) -> Node<()>
Value-level sink sugar. A returned cleanup is registered as onDeactivation.
Sourcepub fn effect_opts<F: Fn(&Values<'_>) -> Option<Box<dyn FnOnce()>> + 'static>(
&self,
deps: Vec<Core>,
f: F,
opts: GraphNodeOpts,
) -> Node<()>
pub fn effect_opts<F: Fn(&Values<'_>) -> Option<Box<dyn FnOnce()>> + 'static>( &self, deps: Vec<Core>, f: F, opts: GraphNodeOpts, ) -> Node<()>
Updates or reads effect_opts.
Sourcepub fn batch<R>(&self, f: impl FnOnce(&BatchCtx) -> R) -> R
pub fn batch<R>(&self, f: impl FnOnce(&BatchCtx) -> R) -> R
Declarative batch (D12): success commits, rollback/panic discards.
Sourcepub fn init_node<T: 'static>(
&self,
op: Operator<T>,
deps: Vec<Core>,
opts: GraphNodeOpts,
) -> Node<T>
pub fn init_node<T: 'static>( &self, op: Operator<T>, deps: Vec<Core>, opts: GraphNodeOpts, ) -> Node<T>
Instantiate a free-standing operator/source as a registered graph node (D43/D40).
Sourcepub fn mount(&self, child: Graph, at: impl Into<String>)
pub fn mount(&self, child: Graph, at: impl Into<String>)
Mount a child graph under a stable :: path prefix.
Sourcepub fn describe(&self) -> DescribeSnapshot
pub fn describe(&self) -> DescribeSnapshot
Static point-in-time inspection snapshot (D39 first cut).
Sourcepub fn describe_opts(&self, opts: DescribeOpts) -> DescribeSnapshot
pub fn describe_opts(&self, opts: DescribeOpts) -> DescribeSnapshot
Updates or reads describe_opts.
Sourcepub fn observe(&self) -> ObserveStream
pub fn observe(&self) -> ObserveStream
Read-only observation egress for every currently registered node in this graph.
Sourcepub fn observe_path(&self, path: &str) -> ObserveStream
pub fn observe_path(&self, path: &str) -> ObserveStream
Read-only observation egress for a single registered id or a :: subtree prefix.
Sourcepub fn observe_topology(&self) -> TopologyStream
pub fn observe_topology(&self) -> TopologyStream
D145 read-only topology lifecycle egress over the existing graph registry.
This is not a graph node, does not subscribe to nodes, and does not publish DATA.
Sourcepub fn observe_topology_path(&self, path: &str) -> TopologyStream
pub fn observe_topology_path(&self, path: &str) -> TopologyStream
Read-only topology lifecycle egress for one registered id or :: subtree prefix.