pub trait Header: Sized {
// Required methods
fn header_name() -> HeaderName;
fn decode(value: &HeaderValue) -> Option<Self>;
fn encode(self) -> HeaderValue;
}Expand description
A trait for any type which represents an HTTP header.
Required Methods§
Sourcefn header_name() -> HeaderName
fn header_name() -> HeaderName
The name of the header.
Sourcefn decode(value: &HeaderValue) -> Option<Self>
fn decode(value: &HeaderValue) -> Option<Self>
Decode the header from a HeaderValue.
Sourcefn encode(self) -> HeaderValue
fn encode(self) -> HeaderValue
Encode the header into a HeaderValue.
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.