Trait Apply

Source
pub trait Apply<T, U> {
    type Output;

    // Required method
    fn apply<F>(self, f: F) -> Self::Output
       where F: FnOnce(T) -> U;
}
Expand description

[ApplyOnce] describes objects capable of applying, or mapping, a function onto a value.

Required Associated Types§

Required Methods§

Source

fn apply<F>(self, f: F) -> Self::Output
where F: FnOnce(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.

Implementations on Foreign Types§

Source§

impl<T, U> Apply<T, U> for Option<T>

Source§

type Output = Option<U>

Source§

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

Implementors§