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
// SPDX-License-Identifier: BUSL-1.1
//! SWIM transport abstraction.
//!
//! The detector talks to the network exclusively through the [`Transport`]
//! trait. Two production-facing impls exist:
//!
//! 1. [`in_memory::InMemoryTransport`] — a tokio-mpsc fabric used by every
//! unit test. Supports per-edge drop and partition injection so tests
//! can deterministically simulate unreachable peers.
//! 2. [`udp::UdpTransport`] — the real wire-level transport that binds a
//! `tokio::net::UdpSocket` and framing-encodes every datagram via
//! [`crate::swim::wire::encode`].
//!
//! The trait is `Send + Sync` and its methods are `async`. Errors are
//! typed [`SwimError`] variants so callers never see raw `io::Error`.
use SocketAddr;
use async_trait;
use crateSwimError;
use crateSwimMessage;
pub use ;
pub use UdpTransport;
/// Abstract SWIM transport. Implementations may be unreliable (UDP-like);
/// the detector assumes nothing about ordering or delivery guarantees.