From 2b4359f23d20b14bae1896512f678d02b7f3c34c Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 3 Nov 2026 03:25:00 +0100 Subject: introduce eager links --- src/document/sync.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/document/sync.rs') 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 { .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)] -- cgit v1.3.1