Skip to main content

ApplyMut

Trait ApplyMut 

Source
pub trait ApplyMut<T> {
    type Cont<_T>;

    // Required method
    fn apply_mut<F>(&mut self, rhs: F) -> &mut Self::Cont<T>
       where F: FnMut(&mut T);
}
Expand description

The ApplyMut trait allows for in-place mapping of a mutable reference to a type T

Required Associated Types§

Source

type Cont<_T>

Required Methods§

Source

fn apply_mut<F>(&mut self, rhs: F) -> &mut Self::Cont<T>
where F: FnMut(&mut T),

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> ApplyMut<T> for Option<T>

Source§

type Cont<U> = Option<U>

Source§

fn apply_mut<F>(&mut self, rhs: F) -> &mut Self::Cont<T>
where F: FnMut(&mut T),

Implementors§