From 694347ad456766004e2792c4b4cda865a8a40386 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 31 Oct 2026 13:25:11 +0100 Subject: rename AutoMerge to Document --- src/state/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/state/mod.rs') diff --git a/src/state/mod.rs b/src/state/mod.rs index 36dd4ad..efa4953 100644 --- a/src/state/mod.rs +++ b/src/state/mod.rs @@ -35,11 +35,11 @@ use std::sync::atomic::AtomicBool; use std::time::Duration; use anyhow::{Result, bail}; -use automerge::AutoCommit; use tokio::sync::{Mutex, RwLock, broadcast, mpsc, watch}; use tokio::time::Instant; use tracing::{debug, error, warn}; +use crate::document::Document; use crate::document::lock::DocumentLock; use crate::document::replica::{Epoch, Stamp}; use crate::document::store::ChangeSet; @@ -59,7 +59,7 @@ pub(crate) enum NodeLifecycle { #[derive(Clone)] pub(crate) struct AppState { - /// The document and its epoch. Derefs to `AutoCommit`. + /// The document and its epoch. Derefs to `Document`. pub(crate) doc: Arc, /// Copy of `doc.epoch` for cheap, lock-free reads (handshakes, keepalives, /peers). @@ -376,7 +376,7 @@ impl AppState { /// Reads the document on the blocking pool; `finish` runs after the lock is released. pub(crate) async fn render( &self, - read: impl FnOnce(&AutoCommit) -> T + Send + 'static, + read: impl FnOnce(&Document) -> T + Send + 'static, finish: impl FnOnce(T) -> R + Send + 'static, ) -> R where @@ -397,7 +397,7 @@ impl AppState { /// Mutates the document on the blocking pool. pub(crate) async fn write_doc( &self, - f: impl FnOnce(&mut AutoCommit) -> T + Send + 'static, + f: impl FnOnce(&mut Document) -> T + Send + 'static, ) -> T where T: Send + 'static, @@ -418,7 +418,7 @@ impl AppState { /// cancelled request can't leave a committed write unannounced. pub(crate) async fn mutate_doc( &self, - f: impl FnOnce(&mut AutoCommit) -> Result + Send + 'static, + f: impl FnOnce(&mut Document) -> Result + Send + 'static, ) -> Result where T: Send + 'static, -- cgit v1.3.1