Trait iron::headers::Header
[−]
[src]
pub trait Header: Send + Sync + Clone + Any {
fn header_name() -> &'static str;
fn parse_header(raw: &[Vec<u8>]) -> Result<Self, Error>;
}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() -> &'static str
Returns the name of the header field this belongs to.
This will become an associated constant once available.
fn parse_header(raw: &[Vec<u8>]) -> Result<Self, Error>
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 IfModifiedSinceimpl<S> Header for Authorization<S> where
S: Scheme + Any,
<S as FromStr>::Err: 'static,impl Header for IfNoneMatchimpl Header for ContentTypeimpl Header for Allowimpl Header for PreferenceAppliedimpl Header for CacheControlimpl Header for Expectimpl Header for Originimpl Header for Cookieimpl Header for AcceptLanguageimpl Header for AccessControlExposeHeadersimpl Header for ReferrerPolicyimpl Header for AccessControlRequestHeadersimpl Header for Fromimpl Header for ContentDispositionimpl Header for TransferEncodingimpl Header for Locationimpl Header for IfRangeimpl Header for Dateimpl Header for ContentEncodingimpl Header for AccessControlRequestMethodimpl Header for AccessControlAllowHeadersimpl Header for Acceptimpl Header for IfMatchimpl Header for Linkimpl Header for SetCookieimpl Header for Refererimpl Header for UserAgentimpl Header for AcceptRangesimpl Header for Serverimpl Header for ContentLengthimpl Header for Upgradeimpl Header for StrictTransportSecurityimpl Header for LastModifiedimpl Header for ContentLanguageimpl Header for AccessControlAllowCredentialsimpl Header for Pragmaimpl Header for AccessControlMaxAgeimpl Header for Preferimpl Header for AccessControlAllowOriginimpl Header for AcceptEncodingimpl Header for Hostimpl Header for Varyimpl Header for Rangeimpl Header for ContentRangeimpl Header for Connectionimpl Header for ETagimpl Header for Expiresimpl Header for AcceptCharsetimpl Header for IfUnmodifiedSinceimpl Header for AccessControlAllowMethods