Trait iter_trait::base::IterMut
[−]
[src]
pub trait IterMut<'a>: Iter<'a> { type ItemMut: RefMut<'a, Self::Item>; type IterMut: Iterator<Item = Self::ItemMut>; fn iter_mut(&'a mut self) -> Self::IterMut; }
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.
Associated Types
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.
type IterMut: Iterator<Item = Self::ItemMut>
Type of the iterator over mutable references.
Required Methods
fn iter_mut(&'a mut self) -> Self::IterMut
Constructs an iterator over mutable references to the data in this collection.
Implementors
impl<'a, T: 'a + Iter<'a>> IterMut<'a> for T where
&'a mut T: IntoIterator,
<&'a mut T as IntoIterator>::Item: RefMut<'a, T::Item>,