pub trait Apply<T, F> {
type Output;
// Required methods
fn apply<U>(&self, f: F) -> Self::Output
where F: Fn(T) -> U;
fn apply_mut<U>(&mut self, f: F) -> Self::Output
where F: FnMut(T) -> U;
}Expand description
A trait for applying a function to a type
Required Associated Types§
Required Methods§
fn apply<U>(&self, f: F) -> Self::Outputwhere
F: Fn(T) -> U,
fn apply_mut<U>(&mut self, f: F) -> Self::Outputwhere
F: FnMut(T) -> U,
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.