Trait FatExt

Source
pub trait FatExt: HugrView {
    // Provided methods
    fn try_fat<OT>(
        &self,
        node: Self::Node,
    ) -> Option<FatNode<'_, OT, Self, Self::Node>>
       where for<'a> &'a OpType: TryInto<&'a OT> { ... }
    fn fat_optype(
        &self,
        node: Self::Node,
    ) -> FatNode<'_, OpType, Self, Self::Node> { ... }
    fn fat_io(
        &self,
        node: Self::Node,
    ) -> Option<(FatNode<'_, Input, Self, Self::Node>, FatNode<'_, Output, Self, Self::Node>)> { ... }
    fn fat_children(
        &self,
        node: Self::Node,
    ) -> impl Iterator<Item = FatNode<'_, OpType, Self, Self::Node>> { ... }
    fn fat_root(&self) -> Option<FatNode<'_, Module, Self, Self::Node>> { ... }
    fn fat_entrypoint<OT>(&self) -> Option<FatNode<'_, OT, Self, Self::Node>>
       where for<'a> &'a OpType: TryInto<&'a OT> { ... }
}
Expand description

An extension trait for HugrView which provides methods that delegate to HugrView and then return the result in FatNode form. See for example FatExt::fat_io.

TODO: Add the remaining HugrView equivalents that make sense.

Provided Methods§

Source

fn try_fat<OT>( &self, node: Self::Node, ) -> Option<FatNode<'_, OT, Self, Self::Node>>
where for<'a> &'a OpType: TryInto<&'a OT>,

Try to create a specific FatNode for a given Node.

Source

fn fat_optype(&self, node: Self::Node) -> FatNode<'_, OpType, Self, Self::Node>

Create a general FatNode for a given Node.

Source

fn fat_io( &self, node: Self::Node, ) -> Option<(FatNode<'_, Input, Self, Self::Node>, FatNode<'_, Output, Self, Self::Node>)>

Try to create Input and Output FatNodes for a given Node. This will succeed only for DataFlow Parent Nodes.

Source

fn fat_children( &self, node: Self::Node, ) -> impl Iterator<Item = FatNode<'_, OpType, Self, Self::Node>>

Create general FatNodes for each of a Node’s children.

Source

fn fat_root(&self) -> Option<FatNode<'_, Module, Self, Self::Node>>

Try to create a specific FatNode for the root of a HugrView.

Source

fn fat_entrypoint<OT>(&self) -> Option<FatNode<'_, OT, Self, Self::Node>>
where for<'a> &'a OpType: TryInto<&'a OT>,

Try to create a specific FatNode for the entrypoint of a HugrView.

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<H: HugrView> FatExt for H