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§
Sourcetype ItemMut: RefMut<'a, Self::Item>
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.