pub trait RejectionCode:
Copy
+ Eq
+ Hash
+ Debug
+ Display
+ Into<&'static str>
+ Send
+ Sync
+ 'static {
const CODES: &'static [CodeInfo];
}Expand description
The code type of a rejection family: a closed, enumerable catalogue.
use errlanes::RejectionCode;
/// The thing is missing.
#[derive(errlanes::Rejection, Debug)]
#[rejection(code = "NOT_FOUND")]
#[error("the thing is missing")]
struct NotFound;
for entry in <NotFoundCode as RejectionCode>::CODES {
assert_eq!(entry.code, "NOT_FOUND");
assert_eq!(entry.description, Some("The thing is missing."));
}Required Associated Constants§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".