summaryrefslogtreecommitdiffstats
path: root/src/transport/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-28 02:11:42 +0100
committertv <tv@krebsco.de>2026-10-28 02:11:42 +0100
commit3c56f0df5c23b5c8d4bc4cc748cbd18812910ffe (patch)
tree1ea9d6ee06c84bc57952c7983d34173f1ee46b50 /src/transport/mod.rs
parentf7c22a02f6619ed5b6469bb660f33ced7e6a2b3e (diff)
failover between transports
Diffstat (limited to 'src/transport/mod.rs')
-rw-r--r--src/transport/mod.rs6
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`).