aboutsummaryrefslogtreecommitdiffstats
path: root/src/state/read.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/read.rs')
-rw-r--r--src/state/read.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/state/read.rs b/src/state/read.rs
index f8323a2..a9b3116 100644
--- a/src/state/read.rs
+++ b/src/state/read.rs
@@ -2,16 +2,15 @@
use std::sync::Arc;
-use automerge::{AutoCommit, ChangeHash};
-
use super::AppState;
use crate::document::replica::Epoch;
+use crate::document::{ChangeHash, Document};
use crate::locks::RwLockExt;
/// A read-only view of the document the node served before it started rejoining.
pub(crate) struct StaleView {
pub(crate) epoch: Epoch,
- pub(crate) doc: Arc<AutoCommit>,
+ pub(crate) doc: Arc<Document>,
}
/// Where a read was served from.
@@ -33,7 +32,7 @@ impl AppState {
&self,
unready_live: bool,
with_heads: bool,
- read: impl FnOnce(&AutoCommit) -> T + Send + 'static,
+ read: impl FnOnce(&Document) -> T + Send + 'static,
finish: impl FnOnce(T) -> R + Send + 'static,
) -> Result<(R, ReadSource, Option<Vec<ChangeHash>>), axum::http::StatusCode>
where
@@ -67,7 +66,7 @@ impl AppState {
async fn render_live<T, R>(
&self,
with_heads: bool,
- read: impl FnOnce(&AutoCommit) -> T + Send + 'static,
+ read: impl FnOnce(&Document) -> T + Send + 'static,
finish: impl FnOnce(T) -> R + Send + 'static,
) -> (R, Option<Vec<ChangeHash>>)
where