Skip to main content

ResultManyExt

Trait ResultManyExt 

Source
pub trait ResultManyExt {
    type Ok;
    type Err;

    // 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, E, const N: usize> ResultManyExt for Result<T, [E; N]>
where E: ErrorTrait + Send + Sync + 'static,

Source§

type Ok = T

Source§

type Err = E

Source§

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

Source§

impl<T, E, const N: usize> ResultManyExt for Result<T, [Err<E>; N]>
where E: ErrorTrait + Send + Sync + 'static,

Source§

type Ok = T

Source§

type Err = E

Source§

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

Source§

impl<T, E> ResultManyExt for Result<T, &[E]>
where E: ErrorTrait + Clone + Send + Sync + 'static,

Source§

type Ok = T

Source§

type Err = E

Source§

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

Source§

impl<T, E> ResultManyExt for Result<T, Vec<E>>
where E: ErrorTrait + Send + Sync + 'static,

Source§

type Ok = T

Source§

type Err = E

Source§

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

Source§

impl<T, E> ResultManyExt for Result<T, Vec<Err<E>>>
where E: ErrorTrait + Send + Sync + 'static,

Source§

type Ok = T

Source§

type Err = E

Source§

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

Implementors§