Trait PortIterator

Source
pub trait PortIterator<P>: Iterator<Item = (Node, P)>
where P: Into<Port> + Copy, Self: Sized,
{ // Provided methods fn dataflow_ports_only( self, hugr: &impl HugrView<Node = Node>, ) -> impl Iterator<Item = (Node, P)> { ... } fn filter_edge_kind( self, predicate: impl Fn(Option<EdgeKind>) -> bool, hugr: &impl HugrView<Node = Node>, ) -> impl Iterator<Item = (Node, P)> { ... } }
Expand description

Trait implementing methods on port iterators.

Provided Methods§

Source

fn dataflow_ports_only( self, hugr: &impl HugrView<Node = Node>, ) -> impl Iterator<Item = (Node, P)>

Filter an iterator of node-ports to only dataflow dependency specifying ports (Value and StateOrder)

Source

fn filter_edge_kind( self, predicate: impl Fn(Option<EdgeKind>) -> bool, hugr: &impl HugrView<Node = Node>, ) -> impl Iterator<Item = (Node, P)>

Filter an iterator of node-ports based on the port kind.

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<I, P> PortIterator<P> for I
where I: Iterator<Item = (Node, P)>, P: Into<Port> + Copy,