pub trait OptionExt<T> {
// Required methods
fn unwrap_logic(self) -> T;
fn and_then_logic<U>(self, f: Mapping<T, Option<U>>) -> Option<U>;
fn map_logic<U>(self, f: Mapping<T, U>) -> Option<U>;
}Required Methods§
Sourcefn unwrap_logic(self) -> T
fn unwrap_logic(self) -> T
Sourcefn and_then_logic<U>(self, f: Mapping<T, Option<U>>) -> Option<U>
fn and_then_logic<U>(self, f: Mapping<T, Option<U>>) -> Option<U>
Same as Option::and_then, but in logic.
⚠
Sourcefn map_logic<U>(self, f: Mapping<T, U>) -> Option<U>
fn map_logic<U>(self, f: Mapping<T, U>) -> Option<U>
Same as Option::map, but in logic.
⚠
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.
Implementations on Foreign Types§
Source§impl<T> OptionExt<T> for Option<T>
impl<T> OptionExt<T> for Option<T>
Source§fn unwrap_logic(self) -> T
fn unwrap_logic(self) -> T
(open)
match self { Some(x) => x, None => such_that(|_| true), }
requires
self != None