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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! A minimal HTTP/2 client: `no_std`, allocation-free, sans-io.
//!
//! # Scope
//!
//! Enough HTTP/2 to be a client and no more. No server, no push, no priority,
//! no trailers, and a small fixed number of concurrent streams. That is not
//! laziness — HTTP/2's full surface is large, and every feature carried is
//! another piece of state that has to be right. What this omits, it omits
//! explicitly, and refuses rather than half-implements.
//!
//! # What is genuinely hard here
//!
//! Two things, and both fail silently rather than loudly:
//!
//! **HPACK's dynamic table is connection state built from the peer's stream.**
//! Skipping an insertion does not lose a header; it shifts every subsequent
//! index, so later headers decode as *different headers*. See [`hpack::dynamic`].
//!
//! **Flow control is not optional.** A receiver starts with a 65535-byte window
//! per stream and per connection, and a sender that has exhausted it simply
//! stops. A long-poll streaming a netmap will deliver exactly 65535 bytes and
//! then hang, which looks like a server fault and is not. See [`conn`].
//!
//! # Sans-io
//!
//! [`conn::Connection`] never touches a socket. It is fed the bytes that arrived
//! and writes the bytes to send, so the same code runs over TCP, over a ts2021
//! Noise channel, and over a captured session in a test.
//!
//! ```
//! let mut connection = micro_h2::Connection::new();
//! let mut out = [0u8; 256];
//! let written = connection.start(&mut out).unwrap();
//! assert!(written > 24); // client preface plus SETTINGS and WINDOW_UPDATE
//! ```
pub use ;
pub use ;