Skip to main content

CategoryExt

Trait CategoryExt 

Source
pub trait CategoryExt {
    type Ret;

    // Required method
    fn _internal_error_mut(self, f: impl FnOnce(&mut Error)) -> Self::Ret;

    // Provided methods
    fn with_category(self, category: Category) -> Self::Ret
       where Self: Sized { ... }
    fn bad_request(self) -> Self::Ret
       where Self: Sized { ... }
}
Expand description

Convenience trait for easily adding categories to errors.

Required Associated Types§

Source

type Ret

The type that is returned from this trait’s functions.

Required Methods§

Source

fn _internal_error_mut(self, f: impl FnOnce(&mut Error)) -> Self::Ret

For internal use.

Provided Methods§

Source

fn with_category(self, category: Category) -> Self::Ret
where Self: Sized,

Convenience trait for easily adding categories to errors.

Source

fn bad_request(self) -> Self::Ret
where Self: Sized,

Convenience method for Category::BadRequest.

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> CategoryExt for Result<T, E>
where E: Into<Error>,

Source§

type Ret = Result<T, Error>

Source§

fn _internal_error_mut(self, f: impl FnOnce(&mut Error)) -> Self::Ret

Implementors§