Trait hugr_llvm::fat::FatExt

source ·
pub trait FatExt: HugrView {
    // Provided methods
    fn try_fat<OT>(&self, node: Node) -> Option<FatNode<'_, OT, Self>>
       where for<'a> &'a OpType: TryInto<&'a OT> { ... }
    fn fat_optype(&self, node: Node) -> FatNode<'_, OpType, Self> { ... }
    fn fat_io(
        &self,
        node: Node,
    ) -> Option<(FatNode<'_, Input, Self>, FatNode<'_, Output, Self>)> { ... }
    fn fat_children(
        &self,
        node: Node,
    ) -> impl Iterator<Item = FatNode<'_, OpType, Self>> { ... }
    fn fat_root<OT>(&self) -> Option<FatNode<'_, OT, Self>>
       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: Node) -> Option<FatNode<'_, OT, Self>>
where for<'a> &'a OpType: TryInto<&'a OT>,

Try to create a specific FatNode for a given Node.

source

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

Create a general FatNode for a given Node.

source

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

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: Node, ) -> impl Iterator<Item = FatNode<'_, OpType, Self>>

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

source

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

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

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<H: HugrView> FatExt for H