Trait headers_ext::Header [−][src]
pub trait Header { const NAME: &'static HeaderName; fn decode(values: &mut Values) -> Option<Self>; fn encode(&self, values: &mut ToValues); }
A trait for any object that will represent a header field and value.
This trait represents the construction and identification of headers, and contains trait-object unsafe methods.
Associated Constants
const NAME: &'static HeaderName
The name of this header.
Required Methods
fn decode(values: &mut Values) -> Option<Self>
Decode this type from a HeaderValue
.
fn encode(&self, values: &mut ToValues)
Encode this type to a HeaderMap
.
This function should be infallible. Any errors converting to a
HeaderValue
should have been caught when parsing or constructing
this value.
Implementors
impl Header for AccessControlAllowCredentials
impl Header for AccessControlRequestMethod
impl<C: Credentials> Header for Authorization<C>
impl Header for CacheControl
impl Header for ContentDisposition
impl Header for ContentLength
impl Header for ContentRange
impl Header for ContentType
impl Header for Expect
impl Header for Host
impl<C: Credentials> Header for ProxyAuthorization<C>
impl Header for Range
impl Header for SecWebsocketVersion
impl Header for SetCookie
impl Header for StrictTransportSecurity