pub trait HugrInternals {
type Portgraph<'p>: LinkView + Clone + 'p
where Self: 'p;
type Node: Copy + Ord + Debug + Display + Hash;
// Required methods
fn portgraph(&self) -> Self::Portgraph<'_>;
fn base_hugr(&self) -> &Hugr;
fn root_node(&self) -> Self::Node;
fn get_pg_index(&self, node: Self::Node) -> NodeIndex;
fn get_node(&self, index: NodeIndex) -> Self::Node;
// Provided method
fn hierarchy(&self) -> Cow<'_, Hierarchy> { ... }
}
Expand description
Trait for accessing the internals of a Hugr(View).
Specifically, this trait provides access to the underlying portgraph view.
Required Associated Types§
Required Methods§
Sourcefn get_pg_index(&self, node: Self::Node) -> NodeIndex
fn get_pg_index(&self, node: Self::Node) -> NodeIndex
Convert a node to a portgraph node index.
Provided Methods§
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.