pub trait StreamingIteratorMut: StreamingIterator {
fn get_mut(&mut self) -> Option<&mut Self::Item>;
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>ⓘNotable traits for MapDerefMut<I, F>impl<I, B, F> Iterator for MapDerefMut<I, F>where
I: StreamingIteratorMut,
F: FnMut(&mut I::Item) -> B, type Item = B;
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
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
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
.
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>ⓘNotable traits for MapDerefMut<I, F>impl<I, B, F> Iterator for MapDerefMut<I, F>where
I: StreamingIteratorMut,
F: FnMut(&mut I::Item) -> B, type Item = B;
where
Self: Sized,
F: FnMut(&mut Self::Item) -> B,
fn map_deref_mut<B, F>(self, f: F) -> MapDerefMut<Self, F>ⓘNotable traits for MapDerefMut<I, F>impl<I, B, F> Iterator for MapDerefMut<I, F>where
I: StreamingIteratorMut,
F: FnMut(&mut I::Item) -> B, type Item = B;
where
Self: Sized,
F: FnMut(&mut Self::Item) -> B,
I: StreamingIteratorMut,
F: FnMut(&mut I::Item) -> B, type Item = B;
Creates a regular, non-streaming iterator which transforms mutable elements of this iterator by passing them to a closure.