From 3c56f0df5c23b5c8d4bc4cc748cbd18812910ffe Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 28 Oct 2026 02:11:42 +0100 Subject: failover between transports --- src/transport/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/transport/mod.rs') 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>, } /// Called with the sender, the message and its `payload_len` (as in `EncodedMessage`). -- cgit v1.3.1