From 2ae7562083f5f96490f90e9398762cf6a024d51e Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Nov 2026 04:00:43 +0000 Subject: document: a unit's name, which the swarm passes on by document::UnitId: the name of a unit of a document as its kind has it, an Automerge change's hash. What the swarm announces, forwards along trees, tells a peer it refused and drops is named so (the dissemination, relay, refusals, AppState::drop_taken), and the session is told so what a peer gets from another; a change's hash it is where the document is asked, and on the wire. --- src/swarm/dissemination.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/swarm/dissemination.rs') diff --git a/src/swarm/dissemination.rs b/src/swarm/dissemination.rs index 4c15d0f..11d9295 100644 --- a/src/swarm/dissemination.rs +++ b/src/swarm/dissemination.rs @@ -11,7 +11,7 @@ use async_trait::async_trait; use tracing::trace; -use crate::document::ChangeHash; +use crate::document::UnitId; use crate::state::AppState; use crate::swarm::tree::Plan; @@ -34,7 +34,7 @@ pub(crate) trait Dissemination: Send + Sync + 'static { state: &AppState, writer: u64, from: &str, - changes: &[ChangeHash], + changes: &[UnitId], ) -> Option; /// What a sync message from `peer` says about how well this works (`/admin/stats`): @@ -46,7 +46,7 @@ pub(crate) trait Dissemination: Send + Sync + 'static { peer: &str, writer: Option, carried: bool, - authors: &[(String, Vec)], + authors: &[(String, Vec)], ); /// `peer` asks us to send it `writer`'s changes at once (`eager`, a GRAFT) or to @@ -59,7 +59,7 @@ pub(crate) trait Dissemination: Send + Sync + 'static { /// `peer` told us of `heads` we lack (a STATUS: an announcement, or its keepalive's), /// for a way that minds which neighbour has changes first (PlumTree). By default /// nothing. - fn announced(&self, peer: &str, heads: &[ChangeHash]) { + fn announced(&self, peer: &str, heads: &[UnitId]) { let _ = (peer, heads); } @@ -83,7 +83,7 @@ pub(crate) async fn pass_on( state: &AppState, writer: u64, from: &str, - changes: &[ChangeHash], + changes: &[UnitId], mut plan: Plan, ) -> Plan { if !changes.is_empty() { -- cgit v1.3.1