Skip to main content

OptionExt

Trait OptionExt 

Source
pub trait OptionExt {
    type Ok;

    // Required method
    fn or_raise<E>(self, err: impl FnOnce() -> E) -> Result<Self::Ok, Err<E>>
       where E: ErrorTrait + Send + Sync + 'static;
}

Required Associated Types§

Required Methods§

Source

fn or_raise<E>(self, err: impl FnOnce() -> E) -> Result<Self::Ok, Err<E>>
where E: ErrorTrait + Send + Sync + 'static,

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

Source§

type Ok = T

Source§

fn or_raise<E>(self, err: impl FnOnce() -> E) -> Result<T, Err<E>>
where E: ErrorTrait + Send + Sync + 'static,

Implementors§