pub struct ValidatedGraph<E> { /* private fields */ }Expand description
A validated DAG: every pad linked once, acyclic, pad counts consistent. Carries the topological node order and per-node edge adjacency for the solver and runner.
Implementations§
Source§impl<E> ValidatedGraph<E>
impl<E> ValidatedGraph<E>
Sourcepub fn to_dot(
&self,
title: &str,
label: impl Fn(NodeId) -> Option<String>,
ann: &DotAnnotations<'_>,
) -> String
pub fn to_dot( &self, title: &str, label: impl Fn(NodeId) -> Option<String>, ann: &DotAnnotations<'_>, ) -> String
Render this graph as Graphviz DOT. label(node) supplies a node’s
display name (typically the element instance name); returning None
falls back to the node’s structural kind, which is the right answer for
a tee / mux that carries no element. ann adds negotiated caps and
memory domains per edge; pass &DotAnnotations::default() for a bare
topology dump.
title names the digraph (Graphviz requires a valid identifier or
quoted string; it is quoted and escaped here).
Source§impl<E> ValidatedGraph<E>
impl<E> ValidatedGraph<E>
pub fn node_count(&self) -> usize
pub fn edge_count(&self) -> usize
Sourcepub fn topo(&self) -> &[NodeId]
pub fn topo(&self) -> &[NodeId]
Nodes in topological order (every node appears after all its inputs).
pub fn kind(&self, node: NodeId) -> NodeKind
Sourcepub fn fanout_policy(&self, node: NodeId) -> FanOutPolicy
pub fn fanout_policy(&self, node: NodeId) -> FanOutPolicy
This node’s fan-out rejection policy (meaningful only on a Tee).
Sourcepub fn node_name(&self, node: NodeId) -> Option<&str>
pub fn node_name(&self, node: NodeId) -> Option<&str>
This node’s explicit instance name (a launch line’s name=), if any. The
runner uses it instead of the auto <category>N.
Sourcepub fn node_log_category(&self, node: NodeId) -> Option<&str>
pub fn node_log_category(&self, node: NodeId) -> Option<&str>
This node’s log-category override (a launch line’s log-category=), if
any. The runner hands it to the element in place of the type category.
pub fn edge(&self, id: usize) -> &Edge
Sourcepub fn edges(&self) -> &[Edge]
pub fn edges(&self) -> &[Edge]
All edges, indexed by edge id (the same index the solver’s Vec<Caps>
solution and the DOT renderer’s per-edge annotations use).
Sourcepub fn take_element(&mut self, node: NodeId) -> Option<E>
pub fn take_element(&mut self, node: NodeId) -> Option<E>
Take the element payload out of a node (the runner moves each element
into its spawned arm). None for tee/muxer nodes or after a prior take.
Sourcepub fn take_node_control(&mut self, node: NodeId) -> Option<ControlProgram>
pub fn take_node_control(&mut self, node: NodeId) -> Option<ControlProgram>
Take this node’s animated-property program (M882), which the runner
resolves against the element and hands to the arm that owns it. None
when nothing on the node is animated.
Sourcepub fn element(&self, node: NodeId) -> Option<&E>
pub fn element(&self, node: NodeId) -> Option<&E>
Borrow a node’s element payload, for building its negotiation
constraint before the runner takes it. None for tee/muxer nodes.
Sourcepub fn element_mut(&mut self, node: NodeId) -> Option<&mut E>
pub fn element_mut(&mut self, node: NodeId) -> Option<&mut E>
Mutably borrow a node’s element payload, for the async source caps
probe and per-node configure_pipeline. None for tee/muxer nodes.