[−][src]Trait typed_headers::Header
Required methods
fn name() -> &'static HeaderName
Returns the name of this header.
The http
crate provides constants for all standard header names. Implementations for
nonstandard headers can use the lazy_static
crate to obtain a static reference to a
HeaderName
.
fn from_values<'a>(
values: &mut ValueIter<'a, HeaderValue>
) -> Result<Option<Self>, Error> where
Self: Sized,
values: &mut ValueIter<'a, HeaderValue>
) -> Result<Option<Self>, Error> where
Self: Sized,
Parses the header from the raw value bytes.
The iterator may be empty, which indicates that the header was not present, and Ok(None)
should be returned.
If the iterator is not exhausted when this function returns, it will be treated as a parse error.
fn to_values(&self, values: &mut ToValues)
Serializes the header to raw values.
Each call to values.append
adds a header entry. Almost all headers should only append a
single value. Set-Cookie
is a rare exception.
This method is infallible. Header implementations should ensure at construction time that they will be able to successfully serialize.
Implementors
impl Header for RetryAfter
[src]
fn name() -> &'static HeaderName
[src]
fn from_values<'a>(
values: &mut ValueIter<'a, HeaderValue>
) -> Result<Option<RetryAfter>, Error>
[src]
values: &mut ValueIter<'a, HeaderValue>
) -> Result<Option<RetryAfter>, Error>
fn to_values(&self, values: &mut ToValues)
[src]
impl Header for Accept
[src]
fn name() -> &'static HeaderName
[src]
fn from_values(
values: &mut ValueIter<HeaderValue>
) -> Result<Option<Accept>, Error>
[src]
values: &mut ValueIter<HeaderValue>
) -> Result<Option<Accept>, Error>
fn to_values(&self, values: &mut ToValues)
[src]
impl Header for AcceptEncoding
[src]
fn name() -> &'static HeaderName
[src]
fn from_values(
values: &mut ValueIter<HeaderValue>
) -> Result<Option<AcceptEncoding>, Error>
[src]
values: &mut ValueIter<HeaderValue>
) -> Result<Option<AcceptEncoding>, Error>
fn to_values(&self, values: &mut ToValues)
[src]
impl Header for Allow
[src]
fn name() -> &'static HeaderName
[src]
fn from_values(
values: &mut ValueIter<HeaderValue>
) -> Result<Option<Allow>, Error>
[src]
values: &mut ValueIter<HeaderValue>
) -> Result<Option<Allow>, Error>
fn to_values(&self, values: &mut ToValues)
[src]
impl Header for Authorization
[src]
fn name() -> &'static HeaderName
[src]
fn from_values(
values: &mut ValueIter<HeaderValue>
) -> Result<Option<Authorization>, Error>
[src]
values: &mut ValueIter<HeaderValue>
) -> Result<Option<Authorization>, Error>
fn to_values(&self, values: &mut ToValues)
[src]
impl Header for ContentEncoding
[src]
fn name() -> &'static HeaderName
[src]
fn from_values(
values: &mut ValueIter<HeaderValue>
) -> Result<Option<ContentEncoding>, Error>
[src]
values: &mut ValueIter<HeaderValue>
) -> Result<Option<ContentEncoding>, Error>
fn to_values(&self, values: &mut ToValues)
[src]
impl Header for ContentLength
[src]
fn name() -> &'static HeaderName
[src]
fn from_values(
values: &mut ValueIter<HeaderValue>
) -> Result<Option<ContentLength>, Error>
[src]
values: &mut ValueIter<HeaderValue>
) -> Result<Option<ContentLength>, Error>
fn to_values(&self, values: &mut ToValues)
[src]
impl Header for ContentType
[src]
fn name() -> &'static HeaderName
[src]
fn from_values(
values: &mut ValueIter<HeaderValue>
) -> Result<Option<ContentType>, Error>
[src]
values: &mut ValueIter<HeaderValue>
) -> Result<Option<ContentType>, Error>
fn to_values(&self, values: &mut ToValues)
[src]
impl Header for Host
[src]
fn name() -> &'static HeaderName
[src]
fn from_values<'a>(
values: &mut ValueIter<'a, HeaderValue>
) -> Result<Option<Host>, Error>
[src]
values: &mut ValueIter<'a, HeaderValue>
) -> Result<Option<Host>, Error>
fn to_values(&self, values: &mut ToValues)
[src]
impl Header for ProxyAuthorization
[src]
fn name() -> &'static HeaderName
[src]
fn from_values(
values: &mut ValueIter<HeaderValue>
) -> Result<Option<ProxyAuthorization>, Error>
[src]
values: &mut ValueIter<HeaderValue>
) -> Result<Option<ProxyAuthorization>, Error>