Trait IterRefMut

Source
pub trait IterRefMut: IntoIterator {
    type IntoIterRefMut<'a>: Iterator<Item = &'a mut Self::Item>
       where Self: 'a;

    // Required method
    fn iter_mut<'a>(&'a mut self) -> Self::IntoIterRefMut<'a>;
}

Required Associated Types§

Source

type IntoIterRefMut<'a>: Iterator<Item = &'a mut Self::Item> where Self: 'a

Required Methods§

Source

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

Iterates over the items as mutable references.

A ‘reference’ is a type that points to a different spot in memory where the actual data is. Being ‘mutable’ means that the reference can change the underlying data.

If you don’t need to change the underlying data then prefer using ‘iter()’

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: IntoIterator> IterRefMut for T
where for<'a> &'a Self: IntoIterator<Item = &'a <Self as IntoIterator>::Item>, for<'a> &'a mut Self: IntoIterator<Item = &'a mut <Self as IntoIterator>::Item>,