[−][src]Trait petgraph::data::ElementIterator
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,
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.