[method]_mut: Mutable reference access

Suffix for access-style methods.

#![allow(unused)]
fn main() {
impl <T> Vec<T> {
    // Simplified
    fn get_mut(&mut self, usize) -> Option<&T>;
}

impl <T> [T] {
    // Simplified
    fn iter_mut(&mut self) -> impl Iterator<Item=&mut T>;
}

impl str {
    fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error>;
}
}
- Mut for Mutability
  • Suffix that signifies the method gives access to a mutable reference.

    Requires mutable access to the value you’re calling this method on.