diff options
| author | tv <tv@krebsco.de> | 2026-11-29 03:15:05 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-29 03:15:05 +0000 |
| commit | 9188fa6e13ea7facfab5fb6f55bf26444ec2c01e (patch) | |
| tree | 28b33908d0519bd21b03ee18bb34126c484ec0bb /src/swarm/bootstrap.rs | |
| parent | c396d33a34ee6685e9a561baa4d3ae4956b697be (diff) | |
document: values read and written through a view any kind of document gives
document::view: Read (the value at a path, plain, typed, a map's keys)
and Write (a value written, one deleted), which Automerge's documents,
writes in progress and documents as they were all are. The member
registry, the users, access control's reads and rules, the topology,
forgetting and bootstrap read and write through them, and name neither
Automerge's ReadDoc and Transactable nor document::store, which is what
an Automerge document can do beyond.
How a swarm holding a store judges what a change writes is handed to
the rules (rules::judge_seen), being its kind of document's to say.
Diffstat (limited to 'src/swarm/bootstrap.rs')
| -rw-r--r-- | src/swarm/bootstrap.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/swarm/bootstrap.rs b/src/swarm/bootstrap.rs index 53b4af8..27b5e6b 100644 --- a/src/swarm/bootstrap.rs +++ b/src/swarm/bootstrap.rs @@ -26,7 +26,7 @@ use uuid::Uuid; use crate::document; use crate::document::meta::{self, SWARM}; use crate::document::replica::Epoch; -use crate::document::store; +use crate::document::view; use crate::document::{ActorId, Document}; use crate::files::{FileKind, Files}; use crate::force::Force; @@ -115,19 +115,19 @@ pub(crate) async fn bootstrap(state: &AppState, seeds: &[String], start: Start) state .mutate_doc(move |doc| { for (path, entry) in &users { - store::write_path(doc, path, entry)?; + view::write_path(doc, path, entry)?; } if let Some(policy) = &policy { - store::write_path(doc, &crate::access::policy::path(), policy)?; + view::write_path(doc, &crate::access::policy::path(), policy)?; } - store::write_path(doc, &swarm_id_path(), &recorded)?; - store::write_path( + view::write_path(doc, &swarm_id_path(), &recorded)?; + view::write_path( doc, &crate::swarm::topology::neighbours_path(), &JsonValue::from(neighbours), )?; - store::write_path(doc, &crate::swarm::topology::topology_path(), &topology)?; - store::write_path( + view::write_path(doc, &crate::swarm::topology::topology_path(), &topology)?; + view::write_path( doc, &crate::swarm::topology::dissemination_path(), &dissemination, @@ -247,7 +247,7 @@ fn swarm_id_path() -> Vec<String> { /// The swarm ID the document names, if any. fn read_swarm_id(doc: &Document) -> Option<String> { - match store::read_path(doc, &swarm_id_path()) { + match view::read_path(doc, &swarm_id_path()) { Ok(Some(JsonValue::String(id))) if !id.is_empty() => Some(id), _ => None, } |
