pub trait DocumentedHeader {
// Required method
fn name() -> &'static str;
// Provided methods
fn description() -> &'static str { ... }
fn example() -> Option<&'static str> { ... }
}Expand description
Type-level descriptor for one HTTP header.
Implementations are typically zero-sized marker structs:
use doxa::DocumentedHeader;
pub struct BearerAuthorization;
impl DocumentedHeader for BearerAuthorization {
fn name() -> &'static str { "Authorization" }
fn description() -> &'static str {
"Bearer JWT issued by the configured identity provider."
}
fn example() -> Option<&'static str> {
Some("Bearer eyJhbGc...")
}
}All accessors are runtime functions (not associated consts) so a
future blanket impl can adapt foreign traits whose names are only
available through methods — e.g. impl<H: headers::Header> DocumentedHeader for H behind an opt-in cargo feature.
Required Methods§
Provided Methods§
Sourcefn description() -> &'static str
fn description() -> &'static str
Human description rendered in the docs UI. Empty string omits the description from the spec.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.