pub trait StreamingIteratorMut: StreamingIterator {
// Required method
fn get_mut(&mut self) -> Option<&mut Self::Item>;
// Provided methods
fn next_mut(&mut self) -> Option<&mut Self::Item> { ... }
fn fold_mut<B, F>(self, init: B, f: F) -> B
where Self: Sized,
F: FnMut(B, &mut Self::Item) -> B { ... }
fn for_each_mut<F>(self, f: F)
where Self: Sized,
F: FnMut(&mut Self::Item) { ... }
fn map_deref_mut<B, F>(self, f: F) -> MapDerefMut<Self, F> ⓘ
where Self: Sized,
F: FnMut(&mut Self::Item) -> B { ... }
fn flatten(self) -> Flatten<Self>
where Self: Sized,
Self::Item: StreamingIterator { ... }
}
Expand description
An interface for dealing with mutable streaming iterators.
Required Methods§
sourcefn get_mut(&mut self) -> Option<&mut Self::Item>
fn get_mut(&mut self) -> Option<&mut Self::Item>
Returns a mutable reference to the current element of the iterator.
The behavior of calling this method before advance
has been called is unspecified.
Modifications through this reference may also have an unspecified effect on further iterator advancement, but implementations are encouraged to document this.
Provided Methods§
sourcefn next_mut(&mut self) -> Option<&mut Self::Item>
fn next_mut(&mut self) -> Option<&mut Self::Item>
Advances the iterator and returns the next mutable value.
The behavior of calling this method after the end of the iterator has been reached is unspecified.
The default implementation simply calls advance
followed by get_mut
.
sourcefn fold_mut<B, F>(self, init: B, f: F) -> Bwhere
Self: Sized,
F: FnMut(B, &mut Self::Item) -> B,
fn fold_mut<B, F>(self, init: B, f: F) -> Bwhere Self: Sized, F: FnMut(B, &mut Self::Item) -> B,
Reduces the iterator’s mutable elements to a single, final value.
sourcefn for_each_mut<F>(self, f: F)where
Self: Sized,
F: FnMut(&mut Self::Item),
fn for_each_mut<F>(self, f: F)where Self: Sized, F: FnMut(&mut Self::Item),
Calls a closure on each mutable element of an iterator.
sourcefn map_deref_mut<B, F>(self, f: F) -> MapDerefMut<Self, F> ⓘwhere
Self: Sized,
F: FnMut(&mut Self::Item) -> B,
fn map_deref_mut<B, F>(self, f: F) -> MapDerefMut<Self, F> ⓘwhere Self: Sized, F: FnMut(&mut Self::Item) -> B,
Creates a regular, non-streaming iterator which transforms mutable elements of this iterator by passing them to a closure.