pub struct WorkflowGraph { /* private fields */ }Expand description
Validated graph-level workflow structure.
Implementations§
Source§impl WorkflowGraph
impl WorkflowGraph
Sourcepub fn new(
nodes: impl Into<Vec<NodeDefinition>>,
edges: impl Into<Vec<EdgeDefinition>>,
) -> Result<Self, WorkflowValidationError>
pub fn new( nodes: impl Into<Vec<NodeDefinition>>, edges: impl Into<Vec<EdgeDefinition>>, ) -> Result<Self, WorkflowValidationError>
Create and validate a workflow graph.
§Errors
Returns an error when nodes or ports are duplicated, when an edge references an undeclared node or the wrong port direction, or when the graph contains a directed cycle.
Sourcepub fn with_cycles_allowed(
nodes: impl Into<Vec<NodeDefinition>>,
edges: impl Into<Vec<EdgeDefinition>>,
) -> Result<Self, WorkflowValidationError>
pub fn with_cycles_allowed( nodes: impl Into<Vec<NodeDefinition>>, edges: impl Into<Vec<EdgeDefinition>>, ) -> Result<Self, WorkflowValidationError>
Create and validate a workflow graph while allowing cycles.
§Errors
Returns an error when nodes or ports are duplicated, or when an edge references an undeclared node or the wrong port direction.
Sourcepub fn nodes(&self) -> &[NodeDefinition]
pub fn nodes(&self) -> &[NodeDefinition]
Declared nodes in stable workflow order.
Sourcepub fn edges(&self) -> &[EdgeDefinition]
pub fn edges(&self) -> &[EdgeDefinition]
Declared edges in stable workflow order.
Sourcepub fn topological_order(&self) -> Result<Vec<NodeId>, WorkflowValidationError>
pub fn topological_order(&self) -> Result<Vec<NodeId>, WorkflowValidationError>
Return a deterministic topological order for the nodes in this graph.
§Errors
Returns an error when the graph is structurally invalid or contains a directed cycle.
Trait Implementations§
Source§impl Clone for WorkflowGraph
impl Clone for WorkflowGraph
Source§fn clone(&self) -> WorkflowGraph
fn clone(&self) -> WorkflowGraph
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 WorkflowGraph
impl Debug for WorkflowGraph
Source§impl PartialEq for WorkflowGraph
impl PartialEq for WorkflowGraph
Source§fn eq(&self, other: &WorkflowGraph) -> bool
fn eq(&self, other: &WorkflowGraph) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for WorkflowGraph
impl StructuralPartialEq for WorkflowGraph
Auto Trait Implementations§
impl Freeze for WorkflowGraph
impl RefUnwindSafe for WorkflowGraph
impl Send for WorkflowGraph
impl Sync for WorkflowGraph
impl Unpin for WorkflowGraph
impl UnsafeUnpin for WorkflowGraph
impl UnwindSafe for WorkflowGraph
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