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

The Accept header.

AcceptCharset

The Accept-Charset header

AcceptEncoding

The Accept-Encoding header

AcceptLanguage

The Accept-Language header

AccessControlAllowHeaders

The Access-Control-Allow-Headers response header, part of CORS.

AccessControlAllowMethods

The Access-Control-Allow-Methods response header, part of CORS.

AccessControlMaxAge

The Access-Control-Max-Age response header, part of CORS.

AccessControlRequestHeaders

The Access-Control-Request-Headers request header, part of CORS.

AccessControlRequestMethod

The Access-Control-Request-Method request header, part of CORS.

Allow

The Allow header. See also https://tools.ietf.org/html/rfc7231#section-7.4.1

Authorization

The Authorization header field.

Basic

Credential holder for Basic Authentication

CacheControl

The Cache-Control header.

Connection

The Connection header.

ContentLength

The Content-Length header.

ContentType

The Content-Type header.

Cookie

The Cookie header. Defined in RFC6265:

Date

The Date header field.

EntityTag

An entity tag

Etag

The Etag header.

Expires

The Expires header field.

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.

IfModifiedSince

The If-Modified-Since header field.

IfUnmodifiedSince

The If-Unmodified-Since header field.

LastModified

The LastModified header field.

Location

The Location header.

Quality

Represents a quality used in quality values.

QualityItem

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

Referer

The Referer header.

Server

The Server header field.

SetCookie

The Set-Cookie header

TransferEncoding

The Transfer-Encoding header.

Upgrade

The Upgrade header.

UserAgent

The User-Agent header field.

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.

IfMatch

The If-Match header

IfNoneMatch

The If-None-Match header defined by HTTP/1.1.

Pragma

The Pragma header defined by HTTP/1.0.

Protocol

Protocol values that can appear in the Upgrade header.

Vary

The Allow header. See also https://tools.ietf.org/html/rfc7231#section-7.1.4

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