aboutsummaryrefslogtreecommitdiffstats
path: root/src/remake/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/remake/mod.rs')
-rw-r--r--src/remake/mod.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/remake/mod.rs b/src/remake/mod.rs
index 01e1e3e..0d3d073 100644
--- a/src/remake/mod.rs
+++ b/src/remake/mod.rs
@@ -37,6 +37,7 @@ mod vote;
#[cfg(test)]
pub(crate) use api::testing;
+pub(crate) use delta::Superseded;
pub(crate) use kind::remake_genesis;
pub(crate) use local::RemakeState;
pub(crate) use switch::run_worker;
@@ -193,6 +194,17 @@ pub(crate) trait Host: Clone + Send + Sync + 'static {
T: Send + 'static,
E: From<StoreError> + Send + 'static;
+ /// What a replay does with writes a newer one superseded (`--superseded-writes`).
+ fn superseded(&self) -> Superseded;
+
+ /// Changes `f` commits itself into the live document (as many as it likes, each
+ /// with its own time), under the write lock, then published and replicated.
+ /// Refused while the document isn't writable, as [`Host::commit_doc`].
+ fn commit_changes<T, F>(&self, f: F) -> impl Future<Output = Result<T, StoreError>> + Send
+ where
+ F: FnOnce(&mut Document) -> T + Send + 'static,
+ T: Send + 'static;
+
/// Lets writes in again, after a rejoin swapped in a document that took none
/// ([`Host::switch_epoch`] with `writable` false).
fn accept_writes(&self) -> impl Future<Output = ()> + Send;