aboutsummaryrefslogtreecommitdiffstats
path: root/src/document/store.rs
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
commit73d071fda276f8d2d948e246e006e5604f2c5742 (patch)
tree792f916a35b01316cabf80fd86dae68f8956616d /src/document/store.rs
parent089ba263cf84483b33070d786e1023520b2c9129 (diff)
move ChangeSet from swarm to document
Diffstat (limited to 'src/document/store.rs')
-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")]