aboutsummaryrefslogtreecommitdiffstats
path: root/src/document/store.rs
diff options
context:
space:
mode:
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")]