Trait apply::Apply
[−]
[src]
pub trait Apply<Res> { fn apply<F: Fn(Self) -> Res>(self, f: F) -> Res where Self: Sized { ... } fn apply_ref<F: Fn(&Self) -> Res>(&self, f: F) -> Res { ... } fn apply_mut<F: Fn(&mut Self) -> Res>(&mut self, f: F) -> Res { ... } }
Represents a type which can have functions applied to it (implemented by default for all types).
Provided Methods
fn apply<F: Fn(Self) -> Res>(self, f: F) -> Res where Self: Sized
Apply a function which takes the parameter by value.
fn apply_ref<F: Fn(&Self) -> Res>(&self, f: F) -> Res
Apply a function which takes the parameter by reference.
fn apply_mut<F: Fn(&mut Self) -> Res>(&mut self, f: F) -> Res
Apply a function which takes the parameter by mutable reference.
Implementors
impl<T: ?Sized, Res> Apply<Res> for T