Skip to main content

OptionExt

Trait OptionExt 

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

Source

fn unwrap_logic(self) -> T

Same as Option::unwrap, but in logic.

logic

requires

false

Source

fn and_then_logic<U>(self, f: Mapping<T, Option<U>>) -> Option<U>

Same as Option::and_then, but in logic.

logic

Source

fn map_logic<U>(self, f: Mapping<T, U>) -> Option<U>

Same as Option::map, but in logic.

logic

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> OptionExt<T> for Option<T>

Source§

fn unwrap_logic(self) -> T

logic(open)

match self {
    Some(x) => x,
    None => any(),
}

requires

self != None

Source§

fn and_then_logic<U>(self, f: Mapping<T, Option<U>>) -> Option<U>

logic(open)

match self {
    None => None,
    Some(x) => f.get(x),
}
Source§

fn map_logic<U>(self, f: Mapping<T, U>) -> Option<U>

logic(open)

match self {
    None => None,
    Some(x) => Some(f.get(x)),
}

Implementors§