From 9188fa6e13ea7facfab5fb6f55bf26444ec2c01e Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Nov 2026 03:15:05 +0000 Subject: 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. --- src/access/bans.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/access/bans.rs') diff --git a/src/access/bans.rs b/src/access/bans.rs index a314f49..999f610 100644 --- a/src/access/bans.rs +++ b/src/access/bans.rs @@ -5,7 +5,8 @@ //! (`access::rules`, judged as the ban stood when they were made), and the tokens it //! issued (`access::token`). Deleting the entry lifts the ban. -use crate::document::{ReadDoc, meta, store}; +use crate::document::meta; +use crate::document::view::{self, Read}; /// Where `node`'s ban is. pub(crate) fn path(node: &str) -> Vec { @@ -13,6 +14,6 @@ pub(crate) fn path(node: &str) -> Vec { } /// Whether `doc` bans `node`. -pub(crate) fn banned(doc: &impl ReadDoc, node: &str) -> bool { - store::read_plain(doc, &path(node)).ok().flatten().is_some() +pub(crate) fn banned(doc: &impl Read, node: &str) -> bool { + view::read_plain(doc, &path(node)).ok().flatten().is_some() } -- cgit v1.3.1