RragResultExt

Trait RragResultExt 

Source
pub trait RragResultExt<T> {
    // Required methods
    fn with_rrag_context(self, context: &str) -> RragResult<T>;
    fn map_to_rrag_error<F>(self, f: F) -> RragResult<T>
       where F: FnOnce() -> RragError;
}
Expand description

Extension trait for adding RRAG context to any Result

Required Methods§

Source

fn with_rrag_context(self, context: &str) -> RragResult<T>

Add context to an error

Source

fn map_to_rrag_error<F>(self, f: F) -> RragResult<T>
where F: FnOnce() -> RragError,

Map to a specific RRAG error type

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<T, E> RragResultExt<T> for Result<T, E>
where E: Error + Send + Sync + 'static,

Source§

fn with_rrag_context(self, context: &str) -> RragResult<T>

Source§

fn map_to_rrag_error<F>(self, f: F) -> RragResult<T>
where F: FnOnce() -> RragError,

Implementors§