Skip to main content

MutableExt

Trait MutableExt 

Source
pub trait MutableExt<A> {
    // Required methods
    fn inspect(&self, f: impl FnMut(&A));
    fn inspect_mut(&self, f: impl FnMut(&mut A));
    fn map<B>(&self, f: impl FnOnce(&A) -> B) -> B;
    fn map_mut<B>(&self, f: impl FnOnce(&mut A) -> B) -> B;

    // Provided methods
    fn into_inner(self) -> A
       where A: Default,
             Self: Sized { ... }
    fn take(&self) -> A
       where A: Default { ... }
}

Required Methods§

Source

fn inspect(&self, f: impl FnMut(&A))

Source

fn inspect_mut(&self, f: impl FnMut(&mut A))

Source

fn map<B>(&self, f: impl FnOnce(&A) -> B) -> B

Source

fn map_mut<B>(&self, f: impl FnOnce(&mut A) -> B) -> B

Provided Methods§

Source

fn into_inner(self) -> A
where A: Default, Self: Sized,

Source

fn take(&self) -> A
where A: Default,

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<A> MutableExt<A> for Mutable<A>

Source§

fn inspect(&self, f: impl FnMut(&A))

Source§

fn inspect_mut(&self, f: impl FnMut(&mut A))

Source§

fn map<B>(&self, f: impl FnOnce(&A) -> B) -> B

Source§

fn map_mut<B>(&self, f: impl FnOnce(&mut A) -> B) -> B

Implementors§