SequenceMut

Trait SequenceMut 

Source
pub trait SequenceMut<Item, Subsequence: SequenceMut<Item, Subsequence> + ?Sized>:
    Sequence<Item, Subsequence>
    + IndexMut<usize, Output = Item>
    + IndexMut<Range<usize>, Output = Subsequence> {
    type IteratorMut<'a>: Iterator<Item = &'a mut Item>
       where Self: 'a,
             Item: 'a;

    // Required method
    fn iter_mut(&mut self) -> Self::IteratorMut<'_>;
}
Expand description

A type behaving like a mutable sequence over the type Item.

That is, its items can be mutated, but the sequence it self can not. For a sequence where items can be appended, rearranged etc. see EditableSequence.

Required Associated Types§

Source

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

The mutable iterator type of the sequence.

Required Methods§

Source

fn iter_mut(&mut self) -> Self::IteratorMut<'_>

Returns a mutable iterator over the sequence.

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.

Implementations on Foreign Types§

Source§

impl<Item> SequenceMut<Item, [Item]> for [Item]

Source§

type IteratorMut<'a> = IterMut<'a, Item> where Item: 'a

Source§

fn iter_mut(&mut self) -> Self::IteratorMut<'_>

Source§

impl<Item> SequenceMut<Item, [Item]> for Vec<Item>

Source§

type IteratorMut<'a> = IterMut<'a, Item> where Item: 'a

Source§

fn iter_mut(&mut self) -> Self::IteratorMut<'_>

Implementors§