aboutsummaryrefslogtreecommitdiffstats
path: root/src/document
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-03 03:25:00 +0100
committertv <tv@krebsco.de>2026-11-03 03:25:00 +0100
commit2b4359f23d20b14bae1896512f678d02b7f3c34c (patch)
treeb2bad51e96393463c5f1ac428f3a43d2028c2044 /src/document
parent8f0b588831ac06913dd01a3ebd8bb523292d992e (diff)
introduce eager links
Diffstat (limited to 'src/document')
-rw-r--r--src/document/sync.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/document/sync.rs b/src/document/sync.rs
index 44ad833..8780bf2 100644
--- a/src/document/sync.rs
+++ b/src/document/sync.rs
@@ -30,6 +30,13 @@ pub(crate) fn decode(payload: &SyncPayload) -> anyhow::Result<Received> {
.map_err(|error| anyhow::anyhow!("Automerge decode failed: {error:?}"))
}
+impl Received {
+ /// Whether it carries changes (it may carry only heads and what the peer needs).
+ pub(crate) fn carries_changes(&self) -> bool {
+ !self.0.changes.is_empty()
+ }
+}
+
/// A sync message being handed to our transport (for Mycelium: the HTTP request is in
/// progress).
#[derive(Clone)]