blob: fb1cdc7e6d08dd04df6db15422bbe0b3919d2861 [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="hyper"><meta name="keywords" content="rust, rustlang, rust-lang, hyper"><title>hyper - 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="../crates.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 crate"><!--[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="#">Crate hyper</a></h2><div class="sidebar-elems"><ul class="block"><li class="version">Version 0.14.26</li><li><a id="all-types" href="all.html">All Items</a></li></ul><section><ul class="block"><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#types">Type Definitions</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">Crate <a class="mod" href="#">hyper</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/hyper/lib.rs.html#1-111">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"><h2 id="hyper"><a href="#hyper">hyper</a></h2>
<p>hyper is a <strong>fast</strong> and <strong>correct</strong> HTTP implementation written in and for Rust.</p>
<h3 id="features"><a href="#features">Features</a></h3>
<ul>
<li>HTTP/1 and HTTP/2</li>
<li>Asynchronous design</li>
<li>Leading in performance</li>
<li>Tested and <strong>correct</strong></li>
<li>Extensive production use</li>
<li><a href="client/index.html">Client</a> and <a href="server/index.html">Server</a> APIs</li>
</ul>
<p>If just starting out, <strong>check out the <a href="https://hyper.rs/guides">Guides</a>
first.</strong></p>
<h3 id="low-level"><a href="#low-level">“Low-level”</a></h3>
<p>hyper is a lower-level HTTP library, meant to be a building block
for libraries and applications.</p>
<p>If looking for just a convenient HTTP client, consider the
<a href="https://crates.io/crates/reqwest">reqwest</a> crate.</p>
<h2 id="optional-features"><a href="#optional-features">Optional Features</a></h2>
<p>hyper uses a set of <a href="https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section">feature flags</a> to reduce the amount of compiled code.
It is possible to just enable certain features over others. By default,
hyper does not enable any features but allows one to enable a subset for
their use case. Below is a list of the available feature flags. You may
also notice above each function, struct and trait there is listed one or
more feature flags that are required for that item to be used.</p>
<p>If you are new to hyper it is possible to enable the <code>full</code> feature flag
which will enable all public APIs. Beware though that this will pull in
many extra dependencies that you may not need.</p>
<p>The following optional features are available:</p>
<ul>
<li><code>http1</code>: Enables HTTP/1 support.</li>
<li><code>http2</code>: Enables HTTP/2 support.</li>
<li><code>client</code>: Enables the HTTP <code>client</code>.</li>
<li><code>server</code>: Enables the HTTP <code>server</code>.</li>
<li><code>runtime</code>: Enables convenient integration with <code>tokio</code>, providing
connectors and acceptors for TCP, and a default executor.</li>
<li><code>tcp</code>: Enables convenient implementations over TCP (using tokio).</li>
<li><code>stream</code>: Provides <code>futures::Stream</code> capabilities.</li>
<li><code>backports</code>: 1.0 functionality backported to 0.14.</li>
<li><code>deprecated</code>: opt-in to deprecation warnings to prepare you for 1.0.</li>
</ul>
</div></details><h2 id="reexports" class="small-section-header"><a href="#reexports">Re-exports</a></h2><div class="item-table"><div class="item-row"><div class="item-left import-item" id="reexport.HeaderMap"><code>pub use crate::http::<a class="struct" href="header/struct.HeaderMap.html" title="struct hyper::header::HeaderMap">HeaderMap</a>;</code></div></div><div class="item-row"><div class="item-left import-item" id="reexport.Client"><code>pub use crate::client::<a class="struct" href="client/struct.Client.html" title="struct hyper::client::Client">Client</a>;</code></div></div><div class="item-row"><div class="item-left import-item" id="reexport.Server"><code>pub use crate::server::<a class="struct" href="server/struct.Server.html" title="struct hyper::server::Server">Server</a>;</code></div></div></div><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="body/index.html" title="hyper::body mod">body</a></div><div class="item-right docblock-short">Streaming bodies for Requests and Responses</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="client/index.html" title="hyper::client mod">client</a></div><div class="item-right docblock-short">HTTP Client</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="ext/index.html" title="hyper::ext mod">ext</a></div><div class="item-right docblock-short">HTTP extensions.</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="header/index.html" title="hyper::header mod">header</a></div><div class="item-right docblock-short">HTTP header types</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="rt/index.html" title="hyper::rt mod">rt</a></div><div class="item-right docblock-short">Runtime components</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="server/index.html" title="hyper::server mod">server</a></div><div class="item-right docblock-short">HTTP Server</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="service/index.html" title="hyper::service mod">service</a></div><div class="item-right docblock-short">Asynchronous Services</div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="upgrade/index.html" title="hyper::upgrade mod">upgrade</a></div><div class="item-right docblock-short">HTTP Upgrades</div></div></div><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.Body.html" title="hyper::Body struct">Body</a></div><div class="item-right docblock-short">A stream of <code>Bytes</code>, used when receiving bodies.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Error.html" title="hyper::Error struct">Error</a></div><div class="item-right docblock-short">Represents errors that can occur handling HTTP streams.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Method.html" title="hyper::Method struct">Method</a></div><div class="item-right docblock-short">The Request Method (VERB)</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Request.html" title="hyper::Request struct">Request</a></div><div class="item-right docblock-short">Represents an HTTP request.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Response.html" title="hyper::Response struct">Response</a></div><div class="item-right docblock-short">Represents an HTTP response</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.StatusCode.html" title="hyper::StatusCode struct">StatusCode</a></div><div class="item-right docblock-short">An HTTP status code (<code>status-code</code> in RFC 7230 et al.).</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Uri.html" title="hyper::Uri struct">Uri</a></div><div class="item-right docblock-short">The URI component of a request.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Version.html" title="hyper::Version struct">Version</a></div><div class="item-right docblock-short">Represents a version of the HTTP spec.</div></div></div><h2 id="types" class="small-section-header"><a href="#types">Type Definitions</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="type" href="type.Result.html" title="hyper::Result type">Result</a></div><div class="item-right docblock-short">Result type often returned from methods that can have hyper <code>Error</code>s.</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>