pub trait NamedHeader: Sized + Send {
const HEADER_NAME: &'static str;
// Required method
fn from_value(value: &str) -> Result<Self, String>;
}Expand description
Trait for types that can be extracted from a named HTTP header.
Required Associated Constants§
Sourceconst HEADER_NAME: &'static str
const HEADER_NAME: &'static str
The header name (lowercase), e.g. "content-type".
Required Methods§
Sourcefn from_value(value: &str) -> Result<Self, String>
fn from_value(value: &str) -> Result<Self, String>
Parse the header value string into this type.
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.