Trait bard::util::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) -> Rwhere F: FnOnce(Self) -> R,

Implementors§

source§

impl<T> Apply for T