aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/access.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-29 03:21:43 +0000
committertv <tv@krebsco.de>2026-11-29 03:21:43 +0000
commite63d30c2581033a85489b10c3f5b252fdbb5049e (patch)
tree5f4e6f65f1cecfb32f841e7ad7d9d106aeb69b20 /src/api/access.rs
parent9188fa6e13ea7facfab5fb6f55bf26444ec2c01e (diff)
state: plain writes take a view to write, Automerge's are asked for as such
AppState::mutate_doc, mutate_doc_registering and mutate_doc_by hand what they are given a document::view::Write: the member registry, the users, sessions, forgetting and bootstrap write through them, and take whatever kind of document gives it. AppState::mutate_doc_for is for what asks more of an Automerge document than values at paths (the store's API, a remake's host, a store's events), and gives the heads after the write. What reads a view takes one of any size (dyn Write among them).
Diffstat (limited to 'src/api/access.rs')
-rw-r--r--src/api/access.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/access.rs b/src/api/access.rs
index 9e8a018..daa0f14 100644
--- a/src/api/access.rs
+++ b/src/api/access.rs
@@ -190,7 +190,7 @@ pub(crate) struct Before {
}
impl Before {
- pub(crate) fn of(doc: &impl crate::document::ReadDoc, user: &str) -> Self {
+ pub(crate) fn of(doc: &(impl crate::document::view::Read + ?Sized), user: &str) -> Self {
use crate::access::registry;
let existed = registry::exists(doc);
Self {
@@ -212,7 +212,7 @@ impl Before {
/// leaving nobody once they merge; then the users in `--protocol-writers` may do
/// everything again (`access::authorize`).
pub(crate) fn registry_kept(
- doc: &impl crate::document::ReadDoc,
+ doc: &(impl crate::document::view::Read + ?Sized),
path: &[String],
before: Before,
user: &str,