Skip to main content

Graph

Struct Graph 

Source
pub struct Graph { /* private fields */ }
Expand description

An executable graph.

Implementations§

Source§

impl Graph

Source

pub fn build( workflow: Workflow, registry: &Registry, ) -> Result<Self, GraphError>

Build and validate a graph from a workflow document.

Source

pub fn from_text(text: &str, registry: &Registry) -> Result<Self, Error>

Parse (JSON or YAML) and build in one step.

Source

pub fn nodes(&self) -> &[GraphNode]

Source

pub fn edges(&self) -> &[GraphEdge]

Source

pub fn node(&self, ix: NodeIx) -> Option<&GraphNode>

Source

pub fn edge(&self, ix: EdgeIx) -> Option<&GraphEdge>

Source

pub fn index_of(&self, id: &str) -> Option<NodeIx>

Look up a node index by id.

Source

pub fn node_by_id(&self, id: &str) -> Option<&GraphNode>

Source

pub fn outgoing(&self, ix: NodeIx) -> &[EdgeIx]

Source

pub fn incoming(&self, ix: NodeIx) -> &[EdgeIx]

Source

pub fn root_scope(&self) -> Option<&Scope>

The root scope.

Source

pub fn scope_of(&self, container: NodeIx) -> Option<&Scope>

The body scope of a container node.

Source

pub fn is_descendant(&self, ix: NodeIx, ancestor: NodeIx) -> bool

Whether ix is (transitively) inside container ancestor.

Source

pub fn warnings(&self) -> &[String]

Non-fatal findings (e.g. unreachable nodes).

Source

pub fn fingerprint(&self) -> &str

Stable fingerprint of the source document, used to validate snapshots.

Source

pub fn workflow(&self) -> &Workflow

The source document.

Trait Implementations§

Source§

impl Debug for Graph

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.