Trait Apply

Source
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§

Source

fn apply<U>(&self, f: F) -> Self::Output
where F: Fn(T) -> U,

Source

fn apply_mut<U>(&mut self, f: F) -> Self::Output
where 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.

Implementors§