pub trait ImplyOption<T: Sized>: Sized + PartialEq<bool> {
// Provided methods
fn then(self, value: T) -> Option<T> { ... }
fn then_do(self, value: impl FnOnce() -> T) -> Option<T> { ... }
}
Expand description
Allows construction of an Option<T>
based on a bool
.
Provided 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.