Trait headers::Header

source ·
pub trait Header {
    // Required methods
    fn name() -> &'static HeaderName;
    fn decode<'i, I>(values: &mut I) -> Result<Self, Error>
       where Self: Sized,
             I: Iterator<Item = &'i HeaderValue>;
    fn encode<E>(&self, values: &mut E)
       where E: Extend<HeaderValue>;
}
Expand description

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§

source

fn name() -> &'static HeaderName

The name of this header.

source

fn decode<'i, I>(values: &mut I) -> Result<Self, Error>
where Self: Sized, I: Iterator<Item = &'i HeaderValue>,

Decode this type from an iterator of HeaderValues.

source

fn encode<E>(&self, values: &mut E)
where E: Extend<HeaderValue>,

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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Header for AcceptRanges

source§

impl Header for AccessControlAllowCredentials

source§

impl Header for AccessControlAllowHeaders

source§

impl Header for AccessControlAllowMethods

source§

impl Header for AccessControlAllowOrigin

source§

impl Header for AccessControlExposeHeaders

source§

impl Header for AccessControlMaxAge

source§

impl Header for AccessControlRequestHeaders

source§

impl Header for AccessControlRequestMethod

source§

impl Header for Age

source§

impl Header for Allow

source§

impl Header for CacheControl

source§

impl Header for Connection

source§

impl Header for ContentDisposition

source§

impl Header for ContentEncoding

source§

impl Header for ContentLength

source§

impl Header for ContentLocation

source§

impl Header for ContentRange

source§

impl Header for ContentType

source§

impl Header for Date

source§

impl Header for ETag

source§

impl Header for Expect

source§

impl Header for Expires

source§

impl Header for Host

source§

impl Header for IfMatch

source§

impl Header for IfModifiedSince

source§

impl Header for IfNoneMatch

source§

impl Header for IfRange

source§

impl Header for IfUnmodifiedSince

source§

impl Header for LastModified

source§

impl Header for Location

source§

impl Header for Origin

source§

impl Header for Pragma

source§

impl Header for Range

source§

impl Header for Referer

source§

impl Header for ReferrerPolicy

source§

impl Header for RetryAfter

source§

impl Header for SecWebsocketAccept

source§

impl Header for SecWebsocketKey

source§

impl Header for SecWebsocketVersion

source§

impl Header for Server

source§

impl Header for SetCookie

source§

impl Header for StrictTransportSecurity

source§

impl Header for Te

source§

impl Header for TransferEncoding

source§

impl Header for Upgrade

source§

impl Header for UserAgent

source§

impl Header for Vary

source§

impl<C: Credentials> Header for Authorization<C>

source§

impl<C: Credentials> Header for ProxyAuthorization<C>