Module hyper::header [] [src]

Headers container, and common header fields.

hyper has the opinion that Headers should be strongly-typed, because that's why we're using Rust in the first place. To set or get any header, an object must implement the Header trait from this module. Several common headers are already provided, such as Host, ContentType, UserAgent, and others.

Modules

parsing

Utility functions for Header implementations.

Structs

Accept

Accept header, defined in RFC7231

AcceptCharset

Accept-Charset header, defined in RFC7231

AcceptEncoding

Accept-Encoding header, defined in RFC7231

AcceptLanguage

Accept-Language header, defined in RFC7231

AcceptRanges

Accept-Ranges header, defined in RFC7233

AccessControlAllowHeaders

Access-Control-Allow-Headers header, part of CORS

AccessControlAllowMethods

Access-Control-Allow-Methods header, part of CORS

AccessControlMaxAge

Access-Control-Max-Age header, part of CORS

AccessControlRequestHeaders

Access-Control-Request-Headers header, part of CORS

AccessControlRequestMethod

Access-Control-Request-Method header, part of CORS

Allow

Allow header, defined in RFC7231

Authorization

Authorization header, defined in RFC7235

Basic

Credential holder for Basic Authentication

CacheControl

Cache-Control header, defined in RFC7234

Connection

Connection header, defined in RFC7230

ContentEncoding

Content-Encoding header, defined in RFC7231

ContentLanguage

Content-Language header, defined in RFC7231

ContentLength

Content-Length header, defined in RFC7230

ContentType

Content-Type header, defined in RFC7231

Cookie

Cookie header, defined in RFC6265

Date

Date header, defined in RFC7231

ETag

ETag header, defined in RFC7232

EntityTag

An entity tag, defined in RFC7232

Expires

Expires header, defined in RFC7234

From

From header, defined in RFC7231

HeaderFormatter

A wrapper around any Header with a Display impl that calls fmt_header.

HeaderView

Returned with the HeadersItems iterator.

Headers

A map of header fields on requests and responses.

HeadersItems

An Iterator over the fields in a Headers map.

Host

The Host header.

HttpDate

A time::Time with HTTP formatting and parsing

IfModifiedSince

If-Modified-Since header, defined in RFC7232

IfUnmodifiedSince

If-Unmodified-Since header, defined in RFC7232

Language

A language tag. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.10

LastModified

Last-Modified header, defined in RFC7232

Location

Location header, defined in RFC7231

Protocol

Protocols that appear in the Upgrade header field

Quality

Represents a quality used in quality values.

QualityItem

Represents an item with a quality value as defined in RFC7231.

Referer

Referer header, defined in RFC7231

Server

Server header, defined in RFC7231

SetCookie

Set-Cookie header, defined RFC6265

TransferEncoding

Transfer-Encoding header, defined in RFC7230

Upgrade

Upgrade header, defined in RFC7230

UserAgent

User-Agent header, defined in RFC7231

Enums

AccessControlAllowOrigin

The Access-Control-Allow-Origin response header, part of CORS

CacheDirective

CacheControl contains a list of these directives.

Charset

A Mime charset.

ConnectionOption

Values that can be in the Connection header.

Encoding

A value to represent an encoding used in Transfer-Encoding or Accept-Encoding header.

Expect

The Expect header.

IfMatch

If-Match header, defined in RFC7232

IfNoneMatch

If-None-Match header, defined in RFC7232

IfRange

If-Range header, defined in RFC7233

Pragma

The Pragma header defined by HTTP/1.0.

ProtocolName

A protocol name used to identify a spefic protocol. Names are case-sensitive except for the WebSocket value.

RangeUnit

Range Units, described in RFC7233

Vary

Vary header, defined in RFC7231

Traits

Header

A trait for any object that will represent a header field and value.

HeaderFormat

A trait for any object that will represent a header field and value.

Scheme

An Authorization scheme to be used in the header.

Functions

q

Convenience function to create a Quality fromt a float.

qitem

Convinience function to wrap a value in a QualityItem Sets q to the default 1.0