IterMut

Trait IterMut 

Source
pub trait IterMut<'a>: Iter<'a> {
    type ItemMut: RefMut<'a, Self::Item>;
    type IterMut: Iterator<Item = Self::ItemMut>;

    // Required method
    fn iter_mut(&'a mut self) -> Self::IterMut;
}
Expand description

A trait for collections which can be iterated by mutable reference.

In most cases, you shouldn’t implement this trait directly; instead, you should implement IntoIterator for a mutable reference of this type, which will in turn implement this trait.

Required Associated Types§

Source

type ItemMut: RefMut<'a, Self::Item>

Type of the mutable references to the data in the collection.

Although this might just be &'a Item, it can also be more complicated. For example, an iterator with Item = (usize, T) might use (usize, &'a mut T) for this instead.

For more information, see the RefMut trait.

Source

type IterMut: Iterator<Item = Self::ItemMut>

Type of the iterator over mutable references.

Required Methods§

Source

fn iter_mut(&'a mut self) -> Self::IterMut

Constructs an iterator over mutable references to the data in this collection.

Implementors§