pub trait ApplyOnce<T> {
type Cont<_T>;
// Required method
fn apply_once<U, F>(self, rhs: F) -> Self::Cont<U>
where F: FnOnce(T) -> U;
}
Expand description
A the ApplyOnce
trait is similar to [Map
], but it consumes the instance instead of
borrowing it;
Required Associated Types§
Required Methods§
fn apply_once<U, F>(self, rhs: F) -> Self::Cont<U>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.