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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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,