1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! # hwire
//!
//! An asynchronous HTTP library with streaming bodies and pluggable runtime and transport
//! interfaces.
//!
//! Much of this codebase is adapted and refined from [hyper](https://github.com/hyperium/hyper),
//! aiming to match its performance and reliability for asynchronous HTTP/1 and HTTP/2.
//!
//! # Cancel safety
//!
//! Request futures support cancellation: dropping a future before it
//! completes is the supported way to cancel the operation. The protocol in
//! use changes what that cancellation actually does on the wire:
//!
//! - **HTTP/1** has no in-protocol way to abort a single request without affecting the shared
//! connection, so dropping an in-flight request future closes the underlying I/O when the
//! connection driver observes the cancellation. Any subsequent call on the same `SendRequest`
//! returns a `canceled` error; the connection cannot be reused.
//! - **HTTP/2**, if a stream has been opened, resets the single stream with `RST_STREAM` (`CANCEL`
//! error code) and notifies the peer as its background tasks are driven rather than continuing to
//! deliver a response body that would be discarded. The shared connection stays usable for other
//! in-flight and future requests.
//! - **HTTP/3**, if a stream has been opened, cancels its unfinished send and receive directions
//! with `H3_REQUEST_CANCELLED`, leaving the shared connection usable. After the response has been
//! delivered, dropping its body only cancels receiving; an unfinished upload can continue
//! independently.
//!
//! Keep driving the connection and its background tasks to complete cancellation.
//!
//! See the documentation on individual futures — for example
//! [`conn::http1::SendRequest::try_send_request`] and the equivalent
//! in [`conn::http2::SendRequest::try_send_request`] — for the protocol-specific behavior on
//! cancellation.
pub use http3;
pub use ;