pub struct WorkflowDefinition { /* private fields */ }Expand description
Parsed workflow definition independent of runtime execution.
Implementations§
Source§impl WorkflowDefinition
impl WorkflowDefinition
Sourcepub const fn new(id: WorkflowId, graph: WorkflowGraph) -> Self
pub const fn new(id: WorkflowId, graph: WorkflowGraph) -> Self
Create a workflow definition from an already validated graph.
Sourcepub fn from_parts(
id: WorkflowId,
nodes: impl Into<Vec<NodeDefinition>>,
edges: impl Into<Vec<EdgeDefinition>>,
) -> Result<Self, WorkflowValidationError>
pub fn from_parts( id: WorkflowId, nodes: impl Into<Vec<NodeDefinition>>, edges: impl Into<Vec<EdgeDefinition>>, ) -> Result<Self, WorkflowValidationError>
Create a workflow definition from raw graph parts.
§Errors
Returns an error when the graph is structurally invalid.
Sourcepub fn empty(name: impl Into<String>) -> Result<Self, IdentifierError>
pub fn empty(name: impl Into<String>) -> Result<Self, IdentifierError>
Create a placeholder workflow with no nodes.
§Errors
Returns an error if the workflow identifier is invalid.
Sourcepub const fn id(&self) -> &WorkflowId
pub const fn id(&self) -> &WorkflowId
Workflow identifier.
Sourcepub const fn graph(&self) -> &WorkflowGraph
pub const fn graph(&self) -> &WorkflowGraph
Validated workflow graph.
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.
Trait Implementations§
Source§impl Clone for WorkflowDefinition
impl Clone for WorkflowDefinition
Source§fn clone(&self) -> WorkflowDefinition
fn clone(&self) -> WorkflowDefinition
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 WorkflowDefinition
impl Debug for WorkflowDefinition
Source§impl PartialEq for WorkflowDefinition
impl PartialEq for WorkflowDefinition
Source§fn eq(&self, other: &WorkflowDefinition) -> bool
fn eq(&self, other: &WorkflowDefinition) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for WorkflowDefinition
impl StructuralPartialEq for WorkflowDefinition
Auto Trait Implementations§
impl Freeze for WorkflowDefinition
impl RefUnwindSafe for WorkflowDefinition
impl Send for WorkflowDefinition
impl Sync for WorkflowDefinition
impl Unpin for WorkflowDefinition
impl UnsafeUnpin for WorkflowDefinition
impl UnwindSafe for WorkflowDefinition
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