diff options
| author | tv <tv@krebsco.de> | 2026-10-31 03:54:45 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-31 03:54:45 +0100 |
| commit | 75cc87154b4328758a7d4d6ad76ea2645636530d (patch) | |
| tree | 6f010c9e7c768aa8d22e2c5934384ebe364b6194 /src/document/store.rs | |
| parent | 4d09dcfcd7432ab303f848342d2f762b57b7c693 (diff) | |
move ChangeSet from swarm to document
Diffstat (limited to 'src/document/store.rs')
| -rw-r--r-- | src/document/store.rs | 11 |
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")] |
