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
//! Sans-IO HTTP/2 client framing layer.
//!
//! This crate provides a pure sans-IO HTTP/2 client framing layer. It has
//! zero runtime dependencies -- the caller feeds bytes in via `recv()` and
//! pulls bytes out via `take_pending_send()`.
//!
//! # Architecture
//!
//! ```text
//! TCP + TLS bytes
//! |
//! +----v----------+
//! | ringline-h2 | HTTP/2 framing + HPACK
//! | H2Connection | H2Event: Response, Data, Trailers, etc.
//! +---------------+
//! ```
//!
//! # Example
//!
//! ```rust,ignore
//! use ringline_h2::{H2Connection, H2Event, HeaderField, Settings};
//!
//! let mut h2 = H2Connection::new(Settings::client_default());
//!
//! // Send the connection preface to the transport.
//! let preface = h2.take_pending_send();
//! transport_send(&preface);
//!
//! // Send a GET request.
//! let stream_id = h2.send_request(&[
//! HeaderField::new(b":method", b"GET"),
//! HeaderField::new(b":path", b"/"),
//! HeaderField::new(b":scheme", b"https"),
//! HeaderField::new(b":authority", b"example.com"),
//! ], true)?;
//! transport_send(&h2.take_pending_send());
//!
//! // Feed received bytes.
//! h2.recv(&received_data)?;
//!
//! // Drain events.
//! while let Some(event) = h2.poll_event() {
//! match event {
//! H2Event::Response { stream_id, headers, end_stream } => { /* ... */ }
//! H2Event::Data { stream_id, data, end_stream } => { /* ... */ }
//! _ => {}
//! }
//! }
//! ```
pub use ;
pub use ;
pub use Frame;
pub use HeaderField;
pub use Settings;