hugr_core::hugr::views

Trait HierarchyView

source
pub trait HierarchyView<'a>: RootTagged + Sized {
    // Required method
    fn try_new(hugr: &'a impl HugrView, root: Node) -> Result<Self, HugrError>;
}
Expand description

A common trait for views of a HUGR hierarchical subgraph.

Required Methods§

source

fn try_new(hugr: &'a impl HugrView, root: Node) -> Result<Self, HugrError>

Create a hierarchical view of a HUGR given a root node.

§Errors

Returns HugrError::InvalidTag if the root isn’t a node of the required OpTag

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, Root> HierarchyView<'a> for DescendantsGraph<'a, Root>
where Root: NodeHandle,

source§

impl<'a, Root> HierarchyView<'a> for SiblingGraph<'a, Root>
where Root: NodeHandle,