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
// Copyright Peter G. Bower 2025-2026.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
//! # Transport trait
//!
//! Connection establishment for the socket-backed transports i.e. TCP,
//! UDS, WebSocket, HTTP, QUIC, and WebTransport.
//!
//! Every wire offers the same two peer roles. A connecting peer reaches
//! a listening endpoint, and an accepting peer binds that endpoint and
//! takes inbound connections from it. Both roles resolve to the wire's
//! read and write halves, so the table readers, table writers, and
//! protocol connections above this layer wrap either peer the same way.
use Future;
use io;
use ;
/// Connection establishment contract for a socket-backed transport.
///
/// Pairs a wire with its endpoint address form and provides both peer
/// roles. [`connect`](Transport::connect) reaches a listening
/// endpoint. [`bind`](Transport::bind) claims the endpoint and
/// returns the wire's listener, and [`accept`](Transport::accept)
/// takes the next inbound connection from it. Each connection arrives
/// as the wire's read and write halves, ready for the transport
/// readers, writers, and protocol connections to wrap.