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§
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
fn take(&self) -> Awhere
A: Default,
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.