pub struct Graph { /* private fields */ }Expand description
An executable graph.
Implementations§
Source§impl Graph
impl Graph
Sourcepub fn build(
workflow: Workflow,
registry: &Registry,
) -> Result<Self, GraphError>
pub fn build( workflow: Workflow, registry: &Registry, ) -> Result<Self, GraphError>
Build and validate a graph from a workflow document.
Sourcepub fn from_text(text: &str, registry: &Registry) -> Result<Self, Error>
pub fn from_text(text: &str, registry: &Registry) -> Result<Self, Error>
Parse (JSON or YAML) and build in one step.
pub fn nodes(&self) -> &[GraphNode]
pub fn edges(&self) -> &[GraphEdge]
pub fn node(&self, ix: NodeIx) -> Option<&GraphNode>
pub fn edge(&self, ix: EdgeIx) -> Option<&GraphEdge>
pub fn node_by_id(&self, id: &str) -> Option<&GraphNode>
pub fn outgoing(&self, ix: NodeIx) -> &[EdgeIx]
pub fn incoming(&self, ix: NodeIx) -> &[EdgeIx]
Sourcepub fn root_scope(&self) -> Option<&Scope>
pub fn root_scope(&self) -> Option<&Scope>
The root scope.
Sourcepub fn scope_of(&self, container: NodeIx) -> Option<&Scope>
pub fn scope_of(&self, container: NodeIx) -> Option<&Scope>
The body scope of a container node.
Sourcepub fn is_descendant(&self, ix: NodeIx, ancestor: NodeIx) -> bool
pub fn is_descendant(&self, ix: NodeIx, ancestor: NodeIx) -> bool
Whether ix is (transitively) inside container ancestor.
Sourcepub fn fingerprint(&self) -> &str
pub fn fingerprint(&self) -> &str
Stable fingerprint of the source document, used to validate snapshots.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Graph
impl !UnwindSafe for Graph
impl Forget for Graph
impl Freeze for Graph
impl Move for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnsafeUnpin for Graph
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