pub struct Graph { /* private fields */ }Expand description
Directed Acryllic Graph representing the flow of execution in that pipeline. Only operates on index and edge information - doesn’t store actual state.
See Registry for where state comes in.
Implementations§
Source§impl Graph
impl Graph
Sourcepub fn generate_trace(&self, registry: &Registry) -> GraphTrace
pub fn generate_trace(&self, registry: &Registry) -> GraphTrace
Generates a trace of the graph.
Source§impl Graph
impl Graph
pub fn new() -> Self
Sourcepub fn from_node_ids(node_ids: &[NodeReflection]) -> Self
pub fn from_node_ids(node_ids: &[NodeReflection]) -> Self
Takes a slice of node indicies and adds them to an unconnected graph.
These are the indices returned by Registry::register
Sourcepub fn add_node(&mut self, id: impl Into<NodeReflection>) -> NodeIndex
pub fn add_node(&mut self, id: impl Into<NodeReflection>) -> NodeIndex
Adds a new node to the graph, by its Registry index.
Sourcepub fn connect(
&mut self,
from_id: impl Into<NodeReflection>,
to_id: impl Into<NodeReflection>,
source_output: Option<&'static str>,
target_input: Option<&'static str>,
) -> Result<(), EdgeCreationError>
pub fn connect( &mut self, from_id: impl Into<NodeReflection>, to_id: impl Into<NodeReflection>, source_output: Option<&'static str>, target_input: Option<&'static str>, ) -> Result<(), EdgeCreationError>
Connects the output of a node to the input of another node, resulting
in a new graph edge. See Registry
Sourcepub fn execute<'reg, S: Stage>(
&self,
registry: &'reg mut Registry,
node_id: NodeId<S>,
) -> Result<&'reg mut S::Output, ErrorWithTrace<NodeExecutionError>>
pub fn execute<'reg, S: Stage>( &self, registry: &'reg mut Registry, node_id: NodeId<S>, ) -> Result<&'reg mut S::Output, ErrorWithTrace<NodeExecutionError>>
Execute the graph in its current state, performing the entire flow of operations. This will find any non-lazy nodes and execute each of them, recursively executing all dependencies first in order to satisfy their input requirements.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Graph
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnwindSafe for Graph
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)