From af9de78d7de36848f6ff115c9710fb90d2468af2 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 30 Nov 2026 13:58:03 +0000 Subject: swarm: a node says the kind of the document it holds In its handshakes, and checks a peer's against it (AppState::kind): a set of events where one carries its store (Holding::of_a_set), else Automerge's, as it was for every node. --- src/state/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/state') diff --git a/src/state/mod.rs b/src/state/mod.rs index 604f6ae..36dab9d 100644 --- a/src/state/mod.rs +++ b/src/state/mod.rs @@ -377,6 +377,16 @@ impl AppState { *self.closing.borrow() } + /// The kind of this node's document (`document::KIND`, or a set of events where + /// one carries its store). + pub(crate) fn kind(&self) -> &'static str { + #[cfg(feature = "federation")] + if self.holding.of_a_set() { + return self.holding.kind(); + } + crate::document::KIND + } + pub(crate) fn local_id(&self) -> &str { self.transport.local_id() } -- cgit v1.3.1