Trait common_error::ext::ErrorExt

source ·
pub trait ErrorExt: StackError {
    // Required method
    fn as_any(&self) -> &dyn Any;

    // Provided methods
    fn status_code(&self) -> StatusCode { ... }
    fn output_msg(&self) -> String
       where Self: Sized { ... }
}
Expand description

Extension to Error in std.

Required Methods§

source

fn as_any(&self) -> &dyn Any

Returns the error as Any so that it can be downcast to a specific implementation.

Provided Methods§

source

fn status_code(&self) -> StatusCode

Map this error to StatusCode.

source

fn output_msg(&self) -> String
where Self: Sized,

Implementors§