pub trait ToHttpStatus {
// Required methods
fn status_code(&self) -> u16;
fn error_code(&self) -> &str;
}Expand description
Convert errors to HTTP status codes for API responses
This trait maps domain errors to appropriate HTTP status codes.
Required Methods§
Sourcefn status_code(&self) -> u16
fn status_code(&self) -> u16
Get the HTTP status code for this error
Sourcefn error_code(&self) -> &str
fn error_code(&self) -> &str
Get the machine-readable error code