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
//! §16.11's framing face — `feature = "codec"`.
//!
//! Two constructors and nothing else. `PLAN.md` §3.3: the codec surface
//! *"falls out of §3.1 for free; the constructors exist only to remove a
//! `use`"*, and the result is *"identical to
//! `Framed::new(conn.open_bi().await?, codec)`"*.
//!
//! That it works at all is entirely `compat::io`'s doing:
//! [`tokio_util::codec::Framed`] needs `AsyncRead + AsyncWrite` on its
//! transport, which [`BiStream`] has because §3 of the contract gives it
//! both. That is the whole of the dependency — which is why the `codec`
//! feature implies `sink` in the manifest but the *type* needs nothing from
//! `compat::stream`.
//!
//! # Deliberately absent
//!
//! There is **no `framed_uni` / `accept_framed_uni`**. `FramedWrite`/
//! `FramedRead` over the two half-handles are not in `PLAN.md` §3.3, and a
//! consumer writes `FramedWrite::new(conn.open_uni().await?, codec)` in one
//! line.
use Framed;
use crateConnectionLost;
use crateHandshake;
use crate;