diff options
| author | tv <tv@krebsco.de> | 2026-10-28 02:11:42 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-28 02:11:42 +0100 |
| commit | 5a1cc7e0e5272d4e4cb35f6aa4671b3c73ba69a8 (patch) | |
| tree | 1870cd9cb1b5280f70c611a824c50fc58d9129b5 /src/transport/mod.rs | |
| parent | 34d7bcb631168a75195d31dd85dc47ba484cdc85 (diff) | |
failover between transports
Diffstat (limited to 'src/transport/mod.rs')
| -rw-r--r-- | src/transport/mod.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/transport/mod.rs b/src/transport/mod.rs index e46e82e..f20110a 100644 --- a/src/transport/mod.rs +++ b/src/transport/mod.rs @@ -134,7 +134,8 @@ pub(crate) struct Status { pub(crate) syncs_with_you: bool, } -#[derive(Debug)] +/// Cheap to clone: large parts are shared (`bytes::Bytes`). +#[derive(Debug, Clone)] pub(crate) enum ParsedMessage { Hello(HelloRequest), HelloReply(HelloReply), @@ -537,6 +538,9 @@ pub(crate) struct EncodedMessage { pub(crate) kind: MessageKind, /// Bytes the message takes on the wire (without the transport's own framing). pub(crate) payload_len: usize, + /// The message itself, under the paths layer (`transport::paths`): to encode it + /// again for another transport when a send there fails. None from a transport. + pub(crate) message: Option<std::sync::Arc<ParsedMessage>>, } /// Called with the sender, the message and its `payload_len` (as in `EncodedMessage`). |
