Skip to main content

OptionOrElseMap

Trait OptionOrElseMap 

Source
pub trait OptionOrElseMap<T> {
    // Required method
    fn or_else_map<U, D, F>(self, default: D, map: F) -> U
       where D: FnOnce() -> U,
             F: FnOnce(T) -> U;
}
Expand description

Option::map_or_else but with the english words in “WYSIWYG” order

Required Methods§

Source

fn or_else_map<U, D, F>(self, default: D, map: F) -> U
where D: FnOnce() -> U, F: FnOnce(T) -> U,

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> OptionOrElseMap<T> for Option<T>

Source§

fn or_else_map<U, D, F>(self, default: D, map: F) -> U
where D: FnOnce() -> U, F: FnOnce(T) -> U,

Implementors§