Trait rama::http::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§

§

impl Header for Forwarded

§

impl Header for Accept

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

§

impl Header for CFConnectingIp

source§

impl Header for CacheControl

§

impl Header for ClientIp

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

§

impl Header for TrueClientIp

source§

impl Header for Upgrade

source§

impl Header for UserAgent

source§

impl Header for Vary

§

impl Header for Via

§

impl Header for XClientIp

§

impl Header for XForwardedFor

§

impl Header for XForwardedHost

§

impl Header for XForwardedProto

§

impl Header for XRealIp

source§

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

source§

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