WithMut

Trait WithMut 

Source
pub trait WithMut<T> {
    // Required method
    fn with_mut<R>(&mut self, f: impl FnOnce(&mut T) -> R) -> R;
}
Expand description

Trait to apply a function to a mutable reference.

Required Methods§

Source

fn with_mut<R>(&mut self, f: impl FnOnce(&mut T) -> R) -> R

Apply a function to this mutable reference.

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, WIM: WithInnerMut<T>> WithMut<T> for WIM

Blanket implementation of WithMut for inner mutable types.