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
//! The runtime-agnostic async substrate for the async driver.
//!
//! Following the quinn model, the crate's async path is **not** bound to any one
//! runtime. It is expressed against two small traits the application supplies an
//! implementation of (or uses the optional [`tokio`](super::tokio) adapter):
//!
//! * [`AsyncConn`] — a full-duplex async byte connection.
//! * [`Runtime`] — TCP connect, timers, and the clock.
//!
//! Both use return-position `impl Future` in traits (stable since Rust 1.75;
//! the crate MSRV is 1.88), so the [`asyncio`](super::asyncio) driver stays
//! generic and we never hand-write a `Future`/`Poll` state machine. The traits
//! are deliberately tiny — no `futures-util`, no `tokio` types — so the core
//! build pulls in no async-ecosystem dependency; an adapter for `futures-io`
//! traits can be added later behind a feature.
use Future;
use io;
use SocketAddr;
use ;
/// A full-duplex async byte stream handed back by a [`Runtime`]. The byte-level
/// analogue of [`std::io::Read`] + [`std::io::Write`]; the driver reads inbound
/// wire bytes and writes a machine's transmits over it.
/// A runtime-agnostic async environment: everything a driver needs from "the
/// outside" beyond the protocol logic. An application implements this for its
/// runtime of choice (or enables the built-in `tokio-rt` adapter); the crate's
/// async code never names a concrete runtime, so it does not fragment the
/// ecosystem into per-runtime crates.