pub struct DataflowGraph { /* private fields */ }Expand description
A dataflow graph representing the transformation pipeline.
Implementations§
Source§impl DataflowGraph
impl DataflowGraph
Sourcepub fn add_node(&mut self, node: Node) -> NodeId
pub fn add_node(&mut self, node: Node) -> NodeId
Add a node to the graph.
Returns the node’s ID for connecting edges.
Sourcepub fn connect(&mut self, from: NodeId, to: NodeId) -> bool
pub fn connect(&mut self, from: NodeId, to: NodeId) -> bool
Connect two nodes with an edge (from -> to).
Returns false if either node doesn’t exist.
Sourcepub fn get_node_mut(&mut self, id: NodeId) -> Option<&mut Node>
pub fn get_node_mut(&mut self, id: NodeId) -> Option<&mut Node>
Get a mutable node by ID.
Sourcepub fn get_node_by_name(&self, name: &str) -> Option<&Node>
pub fn get_node_by_name(&self, name: &str) -> Option<&Node>
Get a node by name.
Sourcepub fn get_id_by_name(&self, name: &str) -> Option<NodeId>
pub fn get_id_by_name(&self, name: &str) -> Option<NodeId>
Get node ID by name.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Get the number of nodes.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Get the number of edges.
Sourcepub fn topological_sort(&self) -> Option<Vec<NodeId>>
pub fn topological_sort(&self) -> Option<Vec<NodeId>>
Perform topological sort of the graph.
Returns None if the graph has cycles.
Sourcepub fn has_cycles(&self) -> bool
pub fn has_cycles(&self) -> bool
Check if the graph has any cycles.
Sourcepub fn reachable_from(&self, start: NodeId) -> HashSet<NodeId>
pub fn reachable_from(&self, start: NodeId) -> HashSet<NodeId>
Find all nodes reachable from a given node.
Trait Implementations§
Source§impl Clone for DataflowGraph
impl Clone for DataflowGraph
Source§fn clone(&self) -> DataflowGraph
fn clone(&self) -> DataflowGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DataflowGraph
impl Debug for DataflowGraph
Auto Trait Implementations§
impl Freeze for DataflowGraph
impl RefUnwindSafe for DataflowGraph
impl Send for DataflowGraph
impl Sync for DataflowGraph
impl Unpin for DataflowGraph
impl UnsafeUnpin for DataflowGraph
impl UnwindSafe for DataflowGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more