[−][src]Trait hyper::header::Header
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 where
Self: Sized,
Self: Sized,
Returns the name of the header field this belongs to.
This will become an associated constant once available.
fn parse_header(raw: &Raw) -> Result<Self> where
Self: Sized,
Self: Sized,
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
.
fn fmt_header(&self, f: &mut Formatter) -> Result
Format a header to outgoing stream.
Most headers should be formatted on one line, and so a common pattern
would be to implement std::fmt::Display
for this type as well, and
then just call f.fmt_line(self)
.
Note
This has the ability to format a header over multiple lines.
The main example here is Set-Cookie
, which requires that every
cookie being set be specified in a separate line. Almost every other
case should only format as 1 single line.
Implementors
impl Header for AccessControlAllowOrigin
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<AccessControlAllowOrigin>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Expect
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Expect>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for IfMatch
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for IfNoneMatch
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for IfRange
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<IfRange>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Pragma
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Pragma>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Range
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Range>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for ReferrerPolicy
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<ReferrerPolicy>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for RetryAfter
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<RetryAfter>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Vary
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Accept
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for AcceptCharset
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for AcceptEncoding
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for AcceptLanguage
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for AcceptRanges
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for AccessControlAllowCredentials
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<AccessControlAllowCredentials>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for AccessControlAllowHeaders
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for AccessControlAllowMethods
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for AccessControlExposeHeaders
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for AccessControlMaxAge
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for AccessControlRequestHeaders
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for AccessControlRequestMethod
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Allow
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for CacheControl
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<CacheControl>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Connection
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for ContentDisposition
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<ContentDisposition>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for ContentEncoding
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for ContentLanguage
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for ContentLength
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<ContentLength>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for ContentLocation
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for ContentRange
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for ContentType
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Cookie
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Cookie>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Date
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for ETag
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Expires
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for From
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Host
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Host>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for IfModifiedSince
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for IfUnmodifiedSince
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for LastEventId
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for LastModified
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Link
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Link>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Location
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Origin
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Origin>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Prefer
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Prefer>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for PreferenceApplied
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<PreferenceApplied>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Referer
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Server
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for SetCookie
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<SetCookie>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for StrictTransportSecurity
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<StrictTransportSecurity>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Te
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for TransferEncoding
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Upgrade
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for UserAgent
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Self>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl Header for Warning
[src]
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Warning>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl<S: Scheme + Any> Header for Authorization<S> where
<S as FromStr>::Err: 'static,
[src]
<S as FromStr>::Err: 'static,
fn header_name() -> &'static str
[src]
fn parse_header(raw: &Raw) -> Result<Authorization<S>>
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
[src]
impl<S: Scheme + Any> Header for ProxyAuthorization<S> where
<S as FromStr>::Err: 'static,
[src]
<S as FromStr>::Err: 'static,