aboutsummaryrefslogtreecommitdiffstats
path: root/src/state/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-31 13:25:11 +0100
committertv <tv@krebsco.de>2026-10-31 13:25:11 +0100
commit694347ad456766004e2792c4b4cda865a8a40386 (patch)
treeebcc97eef8ffd9954e3ecae75bcf5935f5c33d9a /src/state/mod.rs
parent028f80f46784b483215ab7a2952cc54fdd46ea5d (diff)
rename AutoMerge to Document
Diffstat (limited to 'src/state/mod.rs')
-rw-r--r--src/state/mod.rs10
1 files changed, 5 insertions, 5 deletions
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<DocumentLock>,
/// 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<T, R>(
&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<T>(
&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<T, E>(
&self,
- f: impl FnOnce(&mut AutoCommit) -> Result<T, E> + Send + 'static,
+ f: impl FnOnce(&mut Document) -> Result<T, E> + Send + 'static,
) -> Result<T, E>
where
T: Send + 'static,