Trait AsErrorsResult

Source
pub trait AsErrorsResult<OkT, ErrorT> {
    // Required methods
    fn as_errors(self) -> Result<OkT, Errors<ErrorT>>;
    fn give_or<E, ErrorRecipientT>(
        self,
        default: OkT,
        errors: &mut ErrorRecipientT,
    ) -> Result<OkT, E>
       where ErrorT: Into<E>,
             ErrorRecipientT: ErrorRecipient<E>;
}
Expand description

Converts to a Result with Errors.

Required Methods§

Source

fn as_errors(self) -> Result<OkT, Errors<ErrorT>>

Convert to a Result with Errors.

Source

fn give_or<E, ErrorRecipientT>( self, default: OkT, errors: &mut ErrorRecipientT, ) -> Result<OkT, E>
where ErrorT: Into<E>, ErrorRecipientT: ErrorRecipient<E>,

If there is an error then gives it and returns the default value.

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<OkT, ErrorT> AsErrorsResult<OkT, ErrorT> for Result<OkT, ErrorT>

Source§

fn as_errors(self) -> Result<OkT, Errors<ErrorT>>

Source§

fn give_or<IntoErrorT, ErrorRecipientT>( self, default: OkT, errors: &mut ErrorRecipientT, ) -> Result<OkT, IntoErrorT>
where ErrorT: Into<IntoErrorT>, ErrorRecipientT: ErrorRecipient<IntoErrorT>,

Implementors§