Skip to main content

IntoErrorResponse

Trait IntoErrorResponse 

Source
pub trait IntoErrorResponse<T> {
    // Required methods
    fn internal_server_error(self) -> Result<T, ErrorResponse>;
    fn not_found(self) -> Result<T, ErrorResponse>;
}
Expand description

Trait for providing convenience functions to mark an error as a given type.

Required Methods§

Source

fn internal_server_error(self) -> Result<T, ErrorResponse>

Mark the error as an internal server error.

Source

fn not_found(self) -> Result<T, ErrorResponse>

Mark the error as caused because the resource could not be found.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> IntoErrorResponse<T> for Option<T>

Source§

impl<T, E: Error + 'static> IntoErrorResponse<T> for Result<T, E>

Implementors§