blob: afa04d41714a0b8f62416f81c455c559a45bf214 [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="HTTP header types"><meta name="keywords" content="rust, rustlang, rust-lang, header"><title>hyper::header - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../hyper/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../hyper/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Module header</a></h2><div class="sidebar-elems"><section><ul class="block"><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#constants">Constants</a></li><li><a href="#traits">Traits</a></li></ul></section></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Module <a href="../index.html">hyper</a>::<wbr><a class="mod" href="#">header</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../../src/http/lib.rs.html#173">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>HTTP header types</p>
<p>The module provides <a href="struct.HeaderName.html"><code>HeaderName</code></a>, <a href="struct.HeaderMap.html"><code>HeaderMap</code></a>, and a number of types
used for interacting with <code>HeaderMap</code>. These types allow representing both
HTTP/1 and HTTP/2 headers.</p>
<h2 id="headername"><a href="#headername"><code>HeaderName</code></a></h2>
<p>The <code>HeaderName</code> type represents both standard header names as well as
custom header names. The type handles the case insensitive nature of header
names and is used as the key portion of <code>HeaderMap</code>. Header names are
normalized to lower case. In other words, when creating a <code>HeaderName</code> with
a string, even if upper case characters are included, when getting a string
representation of the <code>HeaderName</code>, it will be all lower case. This allows
for faster <code>HeaderMap</code> comparison operations.</p>
<p>The internal representation is optimized to efficiently handle the cases
most commonly encountered when working with HTTP. Standard header names are
special cased and are represented internally as an enum. Short custom
headers will be stored directly in the <code>HeaderName</code> struct and will not
incur any allocation overhead, however longer strings will require an
allocation for storage.</p>
<h3 id="limitations"><a href="#limitations">Limitations</a></h3>
<p><code>HeaderName</code> has a max length of 32,768 for header names. Attempting to
parse longer names will result in a panic.</p>
<h2 id="headermap"><a href="#headermap"><code>HeaderMap</code></a></h2>
<p><code>HeaderMap</code> is a map structure of header names highly optimized for use
cases common with HTTP. It is a <a href="https://en.wikipedia.org/wiki/Multimap">multimap</a> structure, where each header name
may have multiple associated header values. Given this, some of the APIs
diverge from <a href="https://doc.rust-lang.org/std/collections/struct.HashMap.html"><code>HashMap</code></a>.</p>
<h3 id="overview"><a href="#overview">Overview</a></h3>
<p>Just like <code>HashMap</code> in Rust’s stdlib, <code>HeaderMap</code> is based on <a href="https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing">Robin Hood
hashing</a>. This algorithm tends to reduce the worst case search times in the
table and enables high load factors without seriously affecting performance.
Internally, keys and values are stored in vectors. As such, each insertion
will not incur allocation overhead. However, once the underlying vector
storage is full, a larger vector must be allocated and all values copied.</p>
<h3 id="deterministic-ordering"><a href="#deterministic-ordering">Deterministic ordering</a></h3>
<p>Unlike Rust’s <code>HashMap</code>, values in <code>HeaderMap</code> are deterministically
ordered. Roughly, values are ordered by insertion. This means that a
function that deterministically operates on a header map can rely on the
iteration order to remain consistent across processes and platforms.</p>
<h3 id="adaptive-hashing"><a href="#adaptive-hashing">Adaptive hashing</a></h3>
<p><code>HeaderMap</code> uses an adaptive hashing strategy in order to efficiently handle
most common cases. All standard headers have statically computed hash values
which removes the need to perform any hashing of these headers at runtime.
The default hash function emphasizes performance over robustness. However,
<code>HeaderMap</code> detects high collision rates and switches to a secure hash
function in those events. The threshold is set such that only denial of
service attacks should trigger it.</p>
<h3 id="limitations-1"><a href="#limitations-1">Limitations</a></h3>
<p><code>HeaderMap</code> can store a maximum of 32,768 headers (header name / value
pairs). Attempting to insert more will result in a panic.</p>
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Drain.html" title="hyper::header::Drain struct">Drain</a></div><div class="item-right docblock-short">A drain iterator for <code>HeaderMap</code>.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.GetAll.html" title="hyper::header::GetAll struct">GetAll</a></div><div class="item-right docblock-short">A view to all values stored in a single entry.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.HeaderMap.html" title="hyper::header::HeaderMap struct">HeaderMap</a></div><div class="item-right docblock-short">A set of HTTP headers</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.HeaderName.html" title="hyper::header::HeaderName struct">HeaderName</a></div><div class="item-right docblock-short">Represents an HTTP header field name</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.HeaderValue.html" title="hyper::header::HeaderValue struct">HeaderValue</a></div><div class="item-right docblock-short">Represents an HTTP header field value.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.IntoIter.html" title="hyper::header::IntoIter struct">IntoIter</a></div><div class="item-right docblock-short">An owning iterator over the entries of a <code>HeaderMap</code>.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.InvalidHeaderName.html" title="hyper::header::InvalidHeaderName struct">InvalidHeaderName</a></div><div class="item-right docblock-short">A possible error when converting a <code>HeaderName</code> from another type.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.InvalidHeaderValue.html" title="hyper::header::InvalidHeaderValue struct">InvalidHeaderValue</a></div><div class="item-right docblock-short">A possible error when converting a <code>HeaderValue</code> from a string or byte
slice.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Iter.html" title="hyper::header::Iter struct">Iter</a></div><div class="item-right docblock-short"><code>HeaderMap</code> entry iterator.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.IterMut.html" title="hyper::header::IterMut struct">IterMut</a></div><div class="item-right docblock-short"><code>HeaderMap</code> mutable entry iterator</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Keys.html" title="hyper::header::Keys struct">Keys</a></div><div class="item-right docblock-short">An iterator over <code>HeaderMap</code> keys.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.OccupiedEntry.html" title="hyper::header::OccupiedEntry struct">OccupiedEntry</a></div><div class="item-right docblock-short">A view into a single occupied location in a <code>HeaderMap</code>.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ToStrError.html" title="hyper::header::ToStrError struct">ToStrError</a></div><div class="item-right docblock-short">A possible error when converting a <code>HeaderValue</code> to a string representation.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.VacantEntry.html" title="hyper::header::VacantEntry struct">VacantEntry</a></div><div class="item-right docblock-short">A view into a single empty location in a <code>HeaderMap</code>.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ValueDrain.html" title="hyper::header::ValueDrain struct">ValueDrain</a></div><div class="item-right docblock-short">An drain iterator of all values associated with a single header name.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ValueIter.html" title="hyper::header::ValueIter struct">ValueIter</a></div><div class="item-right docblock-short">An iterator of all values associated with a single header name.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ValueIterMut.html" title="hyper::header::ValueIterMut struct">ValueIterMut</a></div><div class="item-right docblock-short">A mutable iterator of all values associated with a single header name.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Values.html" title="hyper::header::Values struct">Values</a></div><div class="item-right docblock-short"><code>HeaderMap</code> value iterator.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ValuesMut.html" title="hyper::header::ValuesMut struct">ValuesMut</a></div><div class="item-right docblock-short"><code>HeaderMap</code> mutable value iterator</div></div></div><h2 id="enums" class="small-section-header"><a href="#enums">Enums</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.Entry.html" title="hyper::header::Entry enum">Entry</a></div><div class="item-right docblock-short">A view into a single location in a <code>HeaderMap</code>, which may be vacant or occupied.</div></div></div><h2 id="constants" class="small-section-header"><a href="#constants">Constants</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ACCEPT.html" title="hyper::header::ACCEPT constant">ACCEPT</a></div><div class="item-right docblock-short">Advertises which content types the client is able to understand.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ACCEPT_CHARSET.html" title="hyper::header::ACCEPT_CHARSET constant">ACCEPT_CHARSET</a></div><div class="item-right docblock-short">Advertises which character set the client is able to understand.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ACCEPT_ENCODING.html" title="hyper::header::ACCEPT_ENCODING constant">ACCEPT_ENCODING</a></div><div class="item-right docblock-short">Advertises which content encoding the client is able to understand.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ACCEPT_LANGUAGE.html" title="hyper::header::ACCEPT_LANGUAGE constant">ACCEPT_LANGUAGE</a></div><div class="item-right docblock-short">Advertises which languages the client is able to understand.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ACCEPT_RANGES.html" title="hyper::header::ACCEPT_RANGES constant">ACCEPT_RANGES</a></div><div class="item-right docblock-short">Marker used by the server to advertise partial request support.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ACCESS_CONTROL_ALLOW_CREDENTIALS.html" title="hyper::header::ACCESS_CONTROL_ALLOW_CREDENTIALS constant">ACCESS_CONTROL_ALLOW_CREDENTIALS</a></div><div class="item-right docblock-short">Preflight response indicating if the response to the request can be
exposed to the page.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ACCESS_CONTROL_ALLOW_HEADERS.html" title="hyper::header::ACCESS_CONTROL_ALLOW_HEADERS constant">ACCESS_CONTROL_ALLOW_HEADERS</a></div><div class="item-right docblock-short">Preflight response indicating permitted HTTP headers.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ACCESS_CONTROL_ALLOW_METHODS.html" title="hyper::header::ACCESS_CONTROL_ALLOW_METHODS constant">ACCESS_CONTROL_ALLOW_METHODS</a></div><div class="item-right docblock-short">Preflight header response indicating permitted access methods.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ACCESS_CONTROL_ALLOW_ORIGIN.html" title="hyper::header::ACCESS_CONTROL_ALLOW_ORIGIN constant">ACCESS_CONTROL_ALLOW_ORIGIN</a></div><div class="item-right docblock-short">Indicates whether the response can be shared with resources with the
given origin.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ACCESS_CONTROL_EXPOSE_HEADERS.html" title="hyper::header::ACCESS_CONTROL_EXPOSE_HEADERS constant">ACCESS_CONTROL_EXPOSE_HEADERS</a></div><div class="item-right docblock-short">Indicates which headers can be exposed as part of the response by
listing their names.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ACCESS_CONTROL_MAX_AGE.html" title="hyper::header::ACCESS_CONTROL_MAX_AGE constant">ACCESS_CONTROL_MAX_AGE</a></div><div class="item-right docblock-short">Indicates how long the results of a preflight request can be cached.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ACCESS_CONTROL_REQUEST_HEADERS.html" title="hyper::header::ACCESS_CONTROL_REQUEST_HEADERS constant">ACCESS_CONTROL_REQUEST_HEADERS</a></div><div class="item-right docblock-short">Informs the server which HTTP headers will be used when an actual
request is made.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ACCESS_CONTROL_REQUEST_METHOD.html" title="hyper::header::ACCESS_CONTROL_REQUEST_METHOD constant">ACCESS_CONTROL_REQUEST_METHOD</a></div><div class="item-right docblock-short">Informs the server know which HTTP method will be used when the actual
request is made.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.AGE.html" title="hyper::header::AGE constant">AGE</a></div><div class="item-right docblock-short">Indicates the time in seconds the object has been in a proxy cache.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ALLOW.html" title="hyper::header::ALLOW constant">ALLOW</a></div><div class="item-right docblock-short">Lists the set of methods support by a resource.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ALT_SVC.html" title="hyper::header::ALT_SVC constant">ALT_SVC</a></div><div class="item-right docblock-short">Advertises the availability of alternate services to clients.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.AUTHORIZATION.html" title="hyper::header::AUTHORIZATION constant">AUTHORIZATION</a></div><div class="item-right docblock-short">Contains the credentials to authenticate a user agent with a server.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.CACHE_CONTROL.html" title="hyper::header::CACHE_CONTROL constant">CACHE_CONTROL</a></div><div class="item-right docblock-short">Specifies directives for caching mechanisms in both requests and
responses.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.CACHE_STATUS.html" title="hyper::header::CACHE_STATUS constant">CACHE_STATUS</a></div><div class="item-right docblock-short">Indicates how caches have handled a response and its corresponding request.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.CDN_CACHE_CONTROL.html" title="hyper::header::CDN_CACHE_CONTROL constant">CDN_CACHE_CONTROL</a></div><div class="item-right docblock-short">Specifies directives that allow origin servers to control the behavior of CDN caches
interposed between them and clients separately from other caches that might handle the
response.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.CONNECTION.html" title="hyper::header::CONNECTION constant">CONNECTION</a></div><div class="item-right docblock-short">Controls whether or not the network connection stays open after the
current transaction finishes.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.CONTENT_DISPOSITION.html" title="hyper::header::CONTENT_DISPOSITION constant">CONTENT_DISPOSITION</a></div><div class="item-right docblock-short">Indicates if the content is expected to be displayed inline.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.CONTENT_ENCODING.html" title="hyper::header::CONTENT_ENCODING constant">CONTENT_ENCODING</a></div><div class="item-right docblock-short">Used to compress the media-type.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.CONTENT_LANGUAGE.html" title="hyper::header::CONTENT_LANGUAGE constant">CONTENT_LANGUAGE</a></div><div class="item-right docblock-short">Used to describe the languages intended for the audience.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.CONTENT_LENGTH.html" title="hyper::header::CONTENT_LENGTH constant">CONTENT_LENGTH</a></div><div class="item-right docblock-short">Indicates the size of the entity-body.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.CONTENT_LOCATION.html" title="hyper::header::CONTENT_LOCATION constant">CONTENT_LOCATION</a></div><div class="item-right docblock-short">Indicates an alternate location for the returned data.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.CONTENT_RANGE.html" title="hyper::header::CONTENT_RANGE constant">CONTENT_RANGE</a></div><div class="item-right docblock-short">Indicates where in a full body message a partial message belongs.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.CONTENT_SECURITY_POLICY.html" title="hyper::header::CONTENT_SECURITY_POLICY constant">CONTENT_SECURITY_POLICY</a></div><div class="item-right docblock-short">Allows controlling resources the user agent is allowed to load for a
given page.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.CONTENT_SECURITY_POLICY_REPORT_ONLY.html" title="hyper::header::CONTENT_SECURITY_POLICY_REPORT_ONLY constant">CONTENT_SECURITY_POLICY_REPORT_ONLY</a></div><div class="item-right docblock-short">Allows experimenting with policies by monitoring their effects.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.CONTENT_TYPE.html" title="hyper::header::CONTENT_TYPE constant">CONTENT_TYPE</a></div><div class="item-right docblock-short">Used to indicate the media type of the resource.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.COOKIE.html" title="hyper::header::COOKIE constant">COOKIE</a></div><div class="item-right docblock-short">Contains stored HTTP cookies previously sent by the server with the
Set-Cookie header.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.DATE.html" title="hyper::header::DATE constant">DATE</a></div><div class="item-right docblock-short">Contains the date and time at which the message was originated.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.DNT.html" title="hyper::header::DNT constant">DNT</a></div><div class="item-right docblock-short">Indicates the client’s tracking preference.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ETAG.html" title="hyper::header::ETAG constant">ETAG</a></div><div class="item-right docblock-short">Identifier for a specific version of a resource.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.EXPECT.html" title="hyper::header::EXPECT constant">EXPECT</a></div><div class="item-right docblock-short">Indicates expectations that need to be fulfilled by the server in order
to properly handle the request.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.EXPIRES.html" title="hyper::header::EXPIRES constant">EXPIRES</a></div><div class="item-right docblock-short">Contains the date/time after which the response is considered stale.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.FORWARDED.html" title="hyper::header::FORWARDED constant">FORWARDED</a></div><div class="item-right docblock-short">Contains information from the client-facing side of proxy servers that
is altered or lost when a proxy is involved in the path of the request.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.FROM.html" title="hyper::header::FROM constant">FROM</a></div><div class="item-right docblock-short">Contains an Internet email address for a human user who controls the
requesting user agent.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.HOST.html" title="hyper::header::HOST constant">HOST</a></div><div class="item-right docblock-short">Specifies the domain name of the server and (optionally) the TCP port
number on which the server is listening.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.IF_MATCH.html" title="hyper::header::IF_MATCH constant">IF_MATCH</a></div><div class="item-right docblock-short">Makes a request conditional based on the E-Tag.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.IF_MODIFIED_SINCE.html" title="hyper::header::IF_MODIFIED_SINCE constant">IF_MODIFIED_SINCE</a></div><div class="item-right docblock-short">Makes a request conditional based on the modification date.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.IF_NONE_MATCH.html" title="hyper::header::IF_NONE_MATCH constant">IF_NONE_MATCH</a></div><div class="item-right docblock-short">Makes a request conditional based on the E-Tag.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.IF_RANGE.html" title="hyper::header::IF_RANGE constant">IF_RANGE</a></div><div class="item-right docblock-short">Makes a request conditional based on range.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.IF_UNMODIFIED_SINCE.html" title="hyper::header::IF_UNMODIFIED_SINCE constant">IF_UNMODIFIED_SINCE</a></div><div class="item-right docblock-short">Makes the request conditional based on the last modification date.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.LAST_MODIFIED.html" title="hyper::header::LAST_MODIFIED constant">LAST_MODIFIED</a></div><div class="item-right docblock-short">Content-Types that are acceptable for the response.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.LINK.html" title="hyper::header::LINK constant">LINK</a></div><div class="item-right docblock-short">Allows the server to point an interested client to another resource
containing metadata about the requested resource.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.LOCATION.html" title="hyper::header::LOCATION constant">LOCATION</a></div><div class="item-right docblock-short">Indicates the URL to redirect a page to.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.MAX_FORWARDS.html" title="hyper::header::MAX_FORWARDS constant">MAX_FORWARDS</a></div><div class="item-right docblock-short">Indicates the max number of intermediaries the request should be sent
through.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.ORIGIN.html" title="hyper::header::ORIGIN constant">ORIGIN</a></div><div class="item-right docblock-short">Indicates where a fetch originates from.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.PRAGMA.html" title="hyper::header::PRAGMA constant">PRAGMA</a></div><div class="item-right docblock-short">HTTP/1.0 header usually used for backwards compatibility.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.PROXY_AUTHENTICATE.html" title="hyper::header::PROXY_AUTHENTICATE constant">PROXY_AUTHENTICATE</a></div><div class="item-right docblock-short">Defines the authentication method that should be used to gain access to
a proxy.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.PROXY_AUTHORIZATION.html" title="hyper::header::PROXY_AUTHORIZATION constant">PROXY_AUTHORIZATION</a></div><div class="item-right docblock-short">Contains the credentials to authenticate a user agent to a proxy server.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.PUBLIC_KEY_PINS.html" title="hyper::header::PUBLIC_KEY_PINS constant">PUBLIC_KEY_PINS</a></div><div class="item-right docblock-short">Associates a specific cryptographic public key with a certain server.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.PUBLIC_KEY_PINS_REPORT_ONLY.html" title="hyper::header::PUBLIC_KEY_PINS_REPORT_ONLY constant">PUBLIC_KEY_PINS_REPORT_ONLY</a></div><div class="item-right docblock-short">Sends reports of pinning violation to the report-uri specified in the
header.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.RANGE.html" title="hyper::header::RANGE constant">RANGE</a></div><div class="item-right docblock-short">Indicates the part of a document that the server should return.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.REFERER.html" title="hyper::header::REFERER constant">REFERER</a></div><div class="item-right docblock-short">Contains the address of the previous web page from which a link to the
currently requested page was followed.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.REFERRER_POLICY.html" title="hyper::header::REFERRER_POLICY constant">REFERRER_POLICY</a></div><div class="item-right docblock-short">Governs which referrer information should be included with requests
made.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.REFRESH.html" title="hyper::header::REFRESH constant">REFRESH</a></div><div class="item-right docblock-short">Informs the web browser that the current page or frame should be
refreshed.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.RETRY_AFTER.html" title="hyper::header::RETRY_AFTER constant">RETRY_AFTER</a></div><div class="item-right docblock-short">The Retry-After response HTTP header indicates how long the user agent
should wait before making a follow-up request. There are two main cases
this header is used:</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.SEC_WEBSOCKET_ACCEPT.html" title="hyper::header::SEC_WEBSOCKET_ACCEPT constant">SEC_WEBSOCKET_ACCEPT</a></div><div class="item-right docblock-short">The |Sec-WebSocket-Accept| header field is used in the WebSocket
opening handshake. It is sent from the server to the client to
confirm that the server is willing to initiate the WebSocket
connection.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.SEC_WEBSOCKET_EXTENSIONS.html" title="hyper::header::SEC_WEBSOCKET_EXTENSIONS constant">SEC_WEBSOCKET_EXTENSIONS</a></div><div class="item-right docblock-short">The |Sec-WebSocket-Extensions| header field is used in the WebSocket
opening handshake. It is initially sent from the client to the
server, and then subsequently sent from the server to the client, to
agree on a set of protocol-level extensions to use for the duration
of the connection.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.SEC_WEBSOCKET_KEY.html" title="hyper::header::SEC_WEBSOCKET_KEY constant">SEC_WEBSOCKET_KEY</a></div><div class="item-right docblock-short">The |Sec-WebSocket-Key| header field is used in the WebSocket opening
handshake. It is sent from the client to the server to provide part
of the information used by the server to prove that it received a
valid WebSocket opening handshake. This helps ensure that the server
does not accept connections from non-WebSocket clients (e.g., HTTP
clients) that are being abused to send data to unsuspecting WebSocket
servers.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.SEC_WEBSOCKET_PROTOCOL.html" title="hyper::header::SEC_WEBSOCKET_PROTOCOL constant">SEC_WEBSOCKET_PROTOCOL</a></div><div class="item-right docblock-short">The |Sec-WebSocket-Protocol| header field is used in the WebSocket
opening handshake. It is sent from the client to the server and back
from the server to the client to confirm the subprotocol of the
connection. This enables scripts to both select a subprotocol and be
sure that the server agreed to serve that subprotocol.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.SEC_WEBSOCKET_VERSION.html" title="hyper::header::SEC_WEBSOCKET_VERSION constant">SEC_WEBSOCKET_VERSION</a></div><div class="item-right docblock-short">The |Sec-WebSocket-Version| header field is used in the WebSocket
opening handshake. It is sent from the client to the server to
indicate the protocol version of the connection. This enables
servers to correctly interpret the opening handshake and subsequent
data being sent from the data, and close the connection if the server
cannot interpret that data in a safe manner.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.SERVER.html" title="hyper::header::SERVER constant">SERVER</a></div><div class="item-right docblock-short">Contains information about the software used by the origin server to
handle the request.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.SET_COOKIE.html" title="hyper::header::SET_COOKIE constant">SET_COOKIE</a></div><div class="item-right docblock-short">Used to send cookies from the server to the user agent.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.STRICT_TRANSPORT_SECURITY.html" title="hyper::header::STRICT_TRANSPORT_SECURITY constant">STRICT_TRANSPORT_SECURITY</a></div><div class="item-right docblock-short">Tells the client to communicate with HTTPS instead of using HTTP.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.TE.html" title="hyper::header::TE constant">TE</a></div><div class="item-right docblock-short">Informs the server of transfer encodings willing to be accepted as part
of the response.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.TRAILER.html" title="hyper::header::TRAILER constant">TRAILER</a></div><div class="item-right docblock-short">Allows the sender to include additional fields at the end of chunked
messages.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.TRANSFER_ENCODING.html" title="hyper::header::TRANSFER_ENCODING constant">TRANSFER_ENCODING</a></div><div class="item-right docblock-short">Specifies the form of encoding used to safely transfer the entity to the
client.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.UPGRADE.html" title="hyper::header::UPGRADE constant">UPGRADE</a></div><div class="item-right docblock-short">Used as part of the exchange to upgrade the protocol.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.UPGRADE_INSECURE_REQUESTS.html" title="hyper::header::UPGRADE_INSECURE_REQUESTS constant">UPGRADE_INSECURE_REQUESTS</a></div><div class="item-right docblock-short">Sends a signal to the server expressing the client’s preference for an
encrypted and authenticated response.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.USER_AGENT.html" title="hyper::header::USER_AGENT constant">USER_AGENT</a></div><div class="item-right docblock-short">Contains a string that allows identifying the requesting client’s
software.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.VARY.html" title="hyper::header::VARY constant">VARY</a></div><div class="item-right docblock-short">Determines how to match future requests with cached responses.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.VIA.html" title="hyper::header::VIA constant">VIA</a></div><div class="item-right docblock-short">Added by proxies to track routing.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.WARNING.html" title="hyper::header::WARNING constant">WARNING</a></div><div class="item-right docblock-short">General HTTP header contains information about possible problems with
the status of the message.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.WWW_AUTHENTICATE.html" title="hyper::header::WWW_AUTHENTICATE constant">WWW_AUTHENTICATE</a></div><div class="item-right docblock-short">Defines the authentication method that should be used to gain access to
a resource.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.X_CONTENT_TYPE_OPTIONS.html" title="hyper::header::X_CONTENT_TYPE_OPTIONS constant">X_CONTENT_TYPE_OPTIONS</a></div><div class="item-right docblock-short">Marker used by the server to indicate that the MIME types advertised in
the <code>content-type</code> headers should not be changed and be followed.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.X_DNS_PREFETCH_CONTROL.html" title="hyper::header::X_DNS_PREFETCH_CONTROL constant">X_DNS_PREFETCH_CONTROL</a></div><div class="item-right docblock-short">Controls DNS prefetching.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.X_FRAME_OPTIONS.html" title="hyper::header::X_FRAME_OPTIONS constant">X_FRAME_OPTIONS</a></div><div class="item-right docblock-short">Indicates whether or not a browser should be allowed to render a page in
a frame.</div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.X_XSS_PROTECTION.html" title="hyper::header::X_XSS_PROTECTION constant">X_XSS_PROTECTION</a></div><div class="item-right docblock-short">Stop pages from loading when an XSS attack is detected.</div></div></div><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.AsHeaderName.html" title="hyper::header::AsHeaderName trait">AsHeaderName</a></div><div class="item-right docblock-short">A marker trait used to identify values that can be used as search keys
to a <code>HeaderMap</code>.</div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.IntoHeaderName.html" title="hyper::header::IntoHeaderName trait">IntoHeaderName</a></div><div class="item-right docblock-short">A marker trait used to identify values that can be used as insert keys
to a <code>HeaderMap</code>.</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="hyper" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>