hugr_llvm::utils::fat

Trait 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.

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