aboutsummaryrefslogtreecommitdiffstats
path: root/src/document
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-31 03:54:45 +0100
committertv <tv@krebsco.de>2026-10-31 03:54:45 +0100
commitd59cec8e6fd56bfbe91e251ec35e3e3e1f3f95dd (patch)
treeb5b2f79179b8b70c5fd0caa6a7c7b76bf853df75 /src/document
parent0bb3924836205a0364aaf0959c7cf387db004794 (diff)
move ChangeSet from swarm to document
Diffstat (limited to 'src/document')
-rw-r--r--src/document/store.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/document/store.rs b/src/document/store.rs
index 061df35..eeebda8 100644
--- a/src/document/store.rs
+++ b/src/document/store.rs
@@ -10,6 +10,17 @@ use serde::Serialize;
use serde_json::Value as JsonValue;
use std::collections::BTreeSet;
+/// Store paths touched by one batch of document changes (`AppState::change_events`).
+#[derive(Debug)]
+pub(crate) struct ChangeSet {
+ pub(crate) paths: Vec<Vec<String>>,
+}
+
+/// Whether one path is within the other (a change at either touches both).
+pub(crate) fn paths_related(a: &[String], b: &[String]) -> bool {
+ a.starts_with(b) || b.starts_with(a)
+}
+
#[derive(Debug, thiserror::Error)]
pub(crate) enum StoreError {
#[error("path crosses a non-map value")]