64 lines
10 KiB
HTML
64 lines
10 KiB
HTML
<!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"><title>hyper - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-ca0dd0c4.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="hyper" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-a410ff4d.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.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]--><rustdoc-topbar><h2><a href="#">Crate hyper</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../hyper/index.html">hyper</a><span class="version">1.8.1</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#hyper" title="hyper">hyper</a><ul><li><a href="#features" title="Features">Features</a></li><li><a href="#low-level" title="“Low-level”">“Low-level”</a></li></ul></li><li><a href="#optional-features" title="Optional Features">Optional Features</a><ul><li><a href="#unstable-features" title="Unstable Features">Unstable Features</a></li></ul></li><li><a href="#stability" title="Stability">Stability</a></li></ul><h3><a href="#reexports">Crate Items</a></h3><ul class="block"><li><a href="#reexports" title="Re-exports">Re-exports</a></li><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>hyper</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/hyper/lib.rs.html#1-139">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="hyper"><a class="doc-anchor" href="#hyper">§</a>hyper</h2>
|
||
<p>hyper is a <strong>fast</strong> and <strong>correct</strong> HTTP implementation written in and for Rust.</p>
|
||
<h3 id="features"><a class="doc-anchor" href="#features">§</a>Features</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/1/">Guides</a>
|
||
first.</strong></p>
|
||
<h3 id="low-level"><a class="doc-anchor" href="#low-level">§</a>“Low-level”</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 class="doc-anchor" href="#optional-features">§</a>Optional Features</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>
|
||
</ul>
|
||
<h3 id="unstable-features"><a class="doc-anchor" href="#unstable-features">§</a>Unstable Features</h3>
|
||
<p>hyper includes a set of unstable optional features that can be enabled through the use of a
|
||
feature flag and a <a href="https://doc.rust-lang.org/reference/conditional-compilation.html">configuration flag</a>.</p>
|
||
<p>The following is a list of feature flags and their corresponding <code>RUSTFLAG</code>:</p>
|
||
<ul>
|
||
<li><code>ffi</code>: Enables C API for hyper <code>hyper_unstable_ffi</code>.</li>
|
||
<li><code>tracing</code>: Enables debug logging with <code>hyper_unstable_tracing</code>.</li>
|
||
</ul>
|
||
<p>For example:</p>
|
||
<div class="example-wrap"><pre class="language-notrust"><code>RUSTFLAGS="--cfg hyper_unstable_tracing" cargo build</code></pre></div><h2 id="stability"><a class="doc-anchor" href="#stability">§</a>Stability</h2>
|
||
<p>It’s worth talking a bit about the stability of hyper. hyper’s API follows
|
||
<a href="https://semver.org">SemVer</a>. Breaking changes will only be introduced in
|
||
major versions, if ever. New additions to the API, such as new types,
|
||
methods, or traits will only be added in minor versions.</p>
|
||
<p>Some parts of hyper are documented as NOT being part of the stable API. The
|
||
following is a brief list, you can read more about each one in the relevant
|
||
part of the documentation.</p>
|
||
<ul>
|
||
<li>Downcasting error types from <code>Error::source()</code> is not considered stable.</li>
|
||
<li>Private dependencies use of global variables is not considered stable.
|
||
So, if a dependency uses <code>log</code> or <code>tracing</code>, hyper doesn’t promise it
|
||
will continue to do so.</li>
|
||
<li>Behavior from default options is not stable. hyper reserves the right to
|
||
add new options that are enabled by default which might alter the
|
||
behavior, for the purposes of protection. It is also possible to <em>change</em>
|
||
what the default options are set to, also in efforts to protect the
|
||
most people possible.</li>
|
||
</ul>
|
||
</div></details><h2 id="reexports" class="section-header">Re-exports<a href="#reexports" class="anchor">§</a></h2><dl class="item-table reexports"><dt id="reexport.header"><code>pub use http::<a class="mod" href="../http/header/index.html" title="mod http::header">header</a>;</code></dt><dt id="reexport.HeaderMap"><code>pub use http::<a class="struct" href="../http/header/map/struct.HeaderMap.html" title="struct http::header::map::HeaderMap">HeaderMap</a>;</code></dt><dt id="reexport.Method"><code>pub use http::<a class="struct" href="../http/method/struct.Method.html" title="struct http::method::Method">Method</a>;</code></dt><dt id="reexport.Request"><code>pub use http::<a class="struct" href="../http/request/struct.Request.html" title="struct http::request::Request">Request</a>;</code></dt><dt id="reexport.Response"><code>pub use http::<a class="struct" href="../http/response/struct.Response.html" title="struct http::response::Response">Response</a>;</code></dt><dt id="reexport.StatusCode"><code>pub use http::<a class="struct" href="../http/status/struct.StatusCode.html" title="struct http::status::StatusCode">StatusCode</a>;</code></dt><dt id="reexport.Uri"><code>pub use http::<a class="struct" href="../http/uri/struct.Uri.html" title="struct http::uri::Uri">Uri</a>;</code></dt><dt id="reexport.Version"><code>pub use http::<a class="struct" href="../http/version/struct.Version.html" title="struct http::version::Version">Version</a>;</code></dt></dl><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="body/index.html" title="mod hyper::body">body</a></dt><dd>Streaming bodies for Requests and Responses</dd><dt><a class="mod" href="client/index.html" title="mod hyper::client">client</a></dt><dd>HTTP Client</dd><dt><a class="mod" href="ext/index.html" title="mod hyper::ext">ext</a></dt><dd>Extensions for HTTP messages in Hyper.</dd><dt><a class="mod" href="rt/index.html" title="mod hyper::rt">rt</a></dt><dd>Runtime components</dd><dt><a class="mod" href="server/index.html" title="mod hyper::server">server</a></dt><dd>HTTP Server</dd><dt><a class="mod" href="service/index.html" title="mod hyper::service">service</a></dt><dd>Asynchronous Services</dd><dt><a class="mod" href="upgrade/index.html" title="mod hyper::upgrade">upgrade</a></dt><dd>HTTP Upgrades</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Error.html" title="struct hyper::Error">Error</a></dt><dd>Represents errors that can occur handling HTTP streams.</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.Result.html" title="type hyper::Result">Result</a></dt><dd>Result type often returned from methods that can have hyper <code>Error</code>s.</dd></dl></section></div></main></body></html> |