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