pub trait ErrorCode:
Debug
+ Send
+ Sync {
// Required methods
fn code(&self) -> &str;
fn status(&self) -> u16;
fn title(&self) -> &str;
// Provided method
fn description(&self) -> &str { ... }
}Expand description
A machine-readable error code with the HTTP status it is sent with and a short title. An
application implements it for its own codes, such as invoice_not_finalised.
Required Methods§
Provided Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
What the code means, for the OpenAPI document. Empty leaves it at the title.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".