Skip to main content

ValidatedGraph

Struct ValidatedGraph 

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

Source

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>

Source

pub fn node_count(&self) -> usize

Source

pub fn edge_count(&self) -> usize

Source

pub fn topo(&self) -> &[NodeId]

Nodes in topological order (every node appears after all its inputs).

Source

pub fn kind(&self, node: NodeId) -> NodeKind

Source

pub fn fanout_policy(&self, node: NodeId) -> FanOutPolicy

This node’s fan-out rejection policy (meaningful only on a Tee).

Source

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.

Source

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.

Source

pub fn edge(&self, id: usize) -> &Edge

Source

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

Source

pub fn in_edges(&self, node: NodeId) -> &[usize]

Edge ids feeding this node’s input pads.

Source

pub fn out_edges(&self, node: NodeId) -> &[usize]

Edge ids leaving this node’s output pads.

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl<E> Debug for ValidatedGraph<E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<E> Freeze for ValidatedGraph<E>
where Vec<Node<E>>: Freeze,

§

impl<E> RefUnwindSafe for ValidatedGraph<E>
where Vec<Node<E>>: RefUnwindSafe,

§

impl<E> Send for ValidatedGraph<E>
where Vec<Node<E>>: Send,

§

impl<E> Sync for ValidatedGraph<E>
where Vec<Node<E>>: Sync,

§

impl<E> Unpin for ValidatedGraph<E>
where Vec<Node<E>>: Unpin,

§

impl<E> UnsafeUnpin for ValidatedGraph<E>
where Vec<Node<E>>: UnsafeUnpin,

§

impl<E> UnwindSafe for ValidatedGraph<E>
where Vec<Node<E>>: UnwindSafe,

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> ElementBound for T
where T: Send,

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 = !

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.