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 | 73d071fda276f8d2d948e246e006e5604f2c5742 (patch) | |
| tree | 792f916a35b01316cabf80fd86dae68f8956616d /src/document | |
| parent | 089ba263cf84483b33070d786e1023520b2c9129 (diff) | |
move ChangeSet from swarm to document
Diffstat (limited to 'src/document')
| -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")] |
