Skip to main content

ErrorResponseExt

Trait ErrorResponseExt 

Source
pub trait ErrorResponseExt {
    // Required methods
    fn to_error_response(&self) -> ErrorResponse;
    fn status_code(&self) -> StatusCode;
}
Expand description

Extension trait for consistent error formatting

Required Methods§

Source

fn to_error_response(&self) -> ErrorResponse

Convert to standardized error response

Source

fn status_code(&self) -> StatusCode

Get the appropriate HTTP status code

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§