Trait fetsig::MutableExt

source ·
pub trait MutableExt<A> {
    // Required methods
    fn inspect(&self, f: impl FnOnce(&A));
    fn inspect_mut(&self, f: impl FnOnce(&mut A));
    fn map<B>(&self, f: impl FnOnce(&A) -> B) -> B;
    fn map_mut<B>(&self, f: impl FnOnce(&mut A) -> B) -> B;
    fn apply(&self, f: impl FnOnce(A) -> A)
       where A: Copy;
    fn apply_cloned(&self, f: impl FnOnce(A) -> A)
       where A: Clone;

    // 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 FnOnce(&A))

source

fn inspect_mut(&self, f: impl FnOnce(&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

source

fn apply(&self, f: impl FnOnce(A) -> A)
where A: Copy,

source

fn apply_cloned(&self, f: impl FnOnce(A) -> A)
where A: Clone,

Provided Methods§

source

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

source

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<A> MutableExt<A> for Mutable<A>

source§

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

source§

fn inspect_mut(&self, f: impl FnOnce(&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

source§

fn apply(&self, f: impl FnOnce(A) -> A)
where A: Copy,

source§

fn apply_cloned(&self, f: impl FnOnce(A) -> A)
where A: Clone,

Implementors§