Trait hyper::header::Header
[-]
[+]
[src]
pub trait Header: Clone + Any + Send + Sync {
fn header_name(marker: Option<Self>) -> &'static str;
fn parse_header(raw: &[Vec<u8>]) -> Option<Self>;
}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.
Required Methods
fn header_name(marker: Option<Self>) -> &'static str
Returns the name of the header field this belongs to.
The market Option is to hint to the type system which implementation
to call. This can be done away with once UFCS arrives.
fn parse_header(raw: &[Vec<u8>]) -> Option<Self>
Parse a header from a raw stream of bytes.
It's possible that a request can include a header field more than once,
and in that case, the slice will have a length greater than 1. However,
it's not necessarily the case that a Header is allowed to have more
than one field value. If that's the case, you should return None
if raw.len() > 1.
Implementors
impl Header for Acceptimpl Header for AcceptEncodingimpl Header for Allowimpl<S: Scheme> Header for Authorization<S>impl Header for CacheControlimpl Header for Cookiesimpl Header for Connectionimpl Header for ContentLengthimpl Header for ContentTypeimpl Header for Dateimpl Header for Etagimpl Header for Expiresimpl Header for Hostimpl Header for LastModifiedimpl Header for IfModifiedSinceimpl Header for Locationimpl Header for Serverimpl Header for SetCookieimpl Header for TransferEncodingimpl Header for Upgradeimpl Header for UserAgentimpl Header for Vary