Skip to main content

ApiErrorExt

Trait ApiErrorExt 

Source
pub trait ApiErrorExt:
    Error
    + Sized
    + Send
    + Sync
    + 'static {
    // Provided method
    fn into_response_with_code(self, code: StatusCode) -> Response { ... }
}
Expand description

Method to convert an std::error::Error into a Response with a specified StatusCode

Provided Methods§

Source

fn into_response_with_code(self, code: StatusCode) -> Response

Consume the error and convert it to a Response with the specified StatusCode

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.

Implementors§

Source§

impl<T> ApiErrorExt for T
where T: Error + Send + Sync + 'static,