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§

source

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§

source

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.

source

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.

source

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.

source

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.

source

fn flatten(self) -> Flatten<Self>where Self: Sized, Self::Item: StreamingIterator,

Creates an iterator which flattens nested streaming iterators.

Implementations on Foreign Types§

source§

impl<'a, I> StreamingIteratorMut for &'a mut Iwhere I: StreamingIteratorMut + ?Sized,

source§

fn get_mut(&mut self) -> Option<&mut Self::Item>

source§

fn next_mut(&mut self) -> Option<&mut Self::Item>

Implementors§

source§

impl<'a, I, T: ?Sized> StreamingIteratorMut for ConvertMut<'a, I, T>where I: Iterator<Item = &'a mut T>,

source§

impl<A, B> StreamingIteratorMut for Chain<A, B>where A: StreamingIteratorMut, B: StreamingIteratorMut<Item = A::Item>,

source§

impl<I> StreamingIteratorMut for Convert<I>where I: Iterator,

source§

impl<I> StreamingIteratorMut for Flatten<I>where I: StreamingIteratorMut, I::Item: StreamingIteratorMut,

source§

impl<I> StreamingIteratorMut for Fuse<I>where I: StreamingIteratorMut,

source§

impl<I> StreamingIteratorMut for Rev<I>where I: DoubleEndedStreamingIteratorMut,

source§

impl<I> StreamingIteratorMut for Skip<I>where I: StreamingIteratorMut,

source§

impl<I> StreamingIteratorMut for Take<I>where I: StreamingIteratorMut,

source§

impl<I, B, F> StreamingIteratorMut for FilterMap<I, B, F>where I: StreamingIterator, F: FnMut(&I::Item) -> Option<B>,

source§

impl<I, B, F> StreamingIteratorMut for Map<I, B, F>where I: StreamingIterator, F: FnMut(&I::Item) -> B,

source§

impl<I, F> StreamingIteratorMut for Filter<I, F>where I: StreamingIteratorMut, F: FnMut(&I::Item) -> bool,

source§

impl<I, F> StreamingIteratorMut for Inspect<I, F>where I: StreamingIteratorMut, F: FnMut(&I::Item),

source§

impl<I, F> StreamingIteratorMut for SkipWhile<I, F>where I: StreamingIteratorMut, F: FnMut(&I::Item) -> bool,

source§

impl<I, F> StreamingIteratorMut for TakeWhile<I, F>where I: StreamingIteratorMut, F: FnMut(&I::Item) -> bool,

source§

impl<I, J, F> StreamingIteratorMut for FlatMap<I, J, F>where I: StreamingIterator, F: FnMut(&I::Item) -> J, J: StreamingIteratorMut,

source§

impl<T> StreamingIteratorMut for Empty<T>

source§

impl<T> StreamingIteratorMut for Once<T>

source§

impl<T> StreamingIteratorMut for Repeat<T>

source§

impl<T> StreamingIteratorMut for WindowsMut<'_, T>

source§

impl<T, F: FnMut() -> Option<T>> StreamingIteratorMut for FromFn<T, F>

source§

impl<T, F: FnMut() -> T> StreamingIteratorMut for RepeatWith<T, F>

source§

impl<T, F: FnMut(T) -> Option<T>> StreamingIteratorMut for Successors<T, F>

source§

impl<T, F: FnOnce() -> T> StreamingIteratorMut for OnceWith<T, F>