aboutsummaryrefslogtreecommitdiffstats
path: root/src/state
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-31 18:07:07 +0100
committertv <tv@krebsco.de>2026-10-31 18:07:07 +0100
commit70beae3b936ee445659e471f40e59ffaa1e1a3d7 (patch)
tree91e24e4c7cf2c739c2cec0f8a6190362d66a45f0 /src/state
parent37815998b9d37a45f440864f6d3149c3ce9e69f1 (diff)
move all automerge references to document
Diffstat (limited to 'src/state')
-rw-r--r--src/state/mod.rs19
-rw-r--r--src/state/session.rs2
2 files changed, 1 insertions, 20 deletions
diff --git a/src/state/mod.rs b/src/state/mod.rs
index 673bd56..8ac1124 100644
--- a/src/state/mod.rs
+++ b/src/state/mod.rs
@@ -394,25 +394,6 @@ impl AppState {
.expect("document read task panicked")
}
- /// Mutates the document on the blocking pool.
- pub(crate) async fn write_doc<T>(
- &self,
- f: impl FnOnce(&mut Document) -> T + Send + 'static,
- ) -> T
- where
- T: Send + 'static,
- {
- let doc = Arc::clone(&self.doc);
- tokio::task::spawn_blocking(move || {
- let mut replica = doc.blocking_write();
- let out = f(&mut replica.doc);
- replica.refresh_heads();
- out
- })
- .await
- .expect("document write task panicked")
- }
-
/// Mutates the document on the blocking pool as one change, then
/// publishes it. Write and notification run in the same blocking task, so a
/// cancelled request can't leave a committed write unannounced.
diff --git a/src/state/session.rs b/src/state/session.rs
index bf5c83f..7305c58 100644
--- a/src/state/session.rs
+++ b/src/state/session.rs
@@ -245,7 +245,7 @@ impl SyncSession {
/// For the simulator's dump: the peer's heads as Automerge knows them, and whether
/// it thinks a message is in flight.
#[cfg(test)]
- pub(crate) fn automerge_view(&self) -> (Option<&[crate::document::ChangeHash]>, bool) {
+ pub(crate) fn sync_view(&self) -> (Option<&[crate::document::ChangeHash]>, bool) {
(self.state.their_heads.as_deref(), self.state.in_flight)
}