Apply

Trait Apply 

Source
pub trait Apply: Sized {
    // Required method
    fn apply<F, R>(self, f: F) -> R
       where F: FnOnce(Self) -> R;
}
Expand description

Apply a function to anything, like let in Kotlin.

Required Methods§

Source

fn apply<F, R>(self, f: F) -> R
where F: FnOnce(Self) -> R,

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§

Source§

impl<T> Apply for T