Trait hugr_core::hugr::internal::HugrInternals

source ·
pub trait HugrInternals {
    type Portgraph<'p>: LinkView + Clone + 'p
       where Self: 'p;

    // Required methods
    fn portgraph(&self) -> Self::Portgraph<'_>;
    fn base_hugr(&self) -> &Hugr;
    fn root_node(&self) -> Node;
}
Expand description

Trait for accessing the internals of a Hugr(View).

Specifically, this trait provides access to the underlying portgraph view.

Required Associated Types§

source

type Portgraph<'p>: LinkView + Clone + 'p where Self: 'p

The underlying portgraph view type.

Required Methods§

source

fn portgraph(&self) -> Self::Portgraph<'_>

Returns a reference to the underlying portgraph.

source

fn base_hugr(&self) -> &Hugr

Returns the Hugr at the base of a chain of views.

source

fn root_node(&self) -> Node

Return the root node of this view.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'g, Root> HugrInternals for DescendantsGraph<'g, Root>
where Root: NodeHandle,

§

type Portgraph<'p> = &'p FilteredGraph<&'g MultiPortGraph, fn(_: NodeIndex, _: &RegionContext<'g>) -> bool, fn(_: PortIndex, _: &RegionContext<'g>) -> bool, RegionContext<'g>> where Self: 'p

source§

impl<'g, Root> HugrInternals for SiblingGraph<'g, Root>
where Root: NodeHandle,

§

type Portgraph<'p> = &'p FilteredGraph<&'g MultiPortGraph, fn(_: NodeIndex, _: &(&'g Hierarchy, NodeIndex)) -> bool, fn(_: PortIndex, _: &(&'g Hierarchy, NodeIndex)) -> bool, (&'g Hierarchy, NodeIndex)> where Self: 'p

source§

impl<'g, Root: NodeHandle> HugrInternals for SiblingMut<'g, Root>

§

type Portgraph<'p> = FilteredGraph<&'p MultiPortGraph, fn(_: NodeIndex, _: &(&'p Hierarchy, NodeIndex)) -> bool, fn(_: PortIndex, _: &(&'p Hierarchy, NodeIndex)) -> bool, (&'p Hierarchy, NodeIndex)> where Root: 'p, 'g: 'p

source§

impl<T: AsRef<Hugr>> HugrInternals for T

§

type Portgraph<'p> = &'p MultiPortGraph where Self: 'p