[][src]Trait petgraph::data::ElementIterator

pub trait ElementIterator<N, E>: Iterator<Item = Element<N, E>> {
    fn filter_elements<F>(self, f: F) -> FilterElements<Self, F>
    where
        Self: Sized,
        F: FnMut(Element<&mut N, &mut E>) -> bool
, { ... } }

Iterator adaptors for iterators of Element.

Provided methods

fn filter_elements<F>(self, f: F) -> FilterElements<Self, F> where
    Self: Sized,
    F: FnMut(Element<&mut N, &mut E>) -> bool

Create an iterator adaptor that filters graph elements.

The function f is called with each element and if its return value is true the element is accepted and if false it is removed. f is called with mutable references to the node and edge weights, so that they can be mutated (but the edge endpoints can not).

This filter adapts the edge source and target indices in the stream so that they are correct after the removals.

Loading content...

Implementors

impl<N, E, I: ?Sized> ElementIterator<N, E> for I where
    I: Iterator<Item = Element<N, E>>, 
[src]

Loading content...