From 2ac2b0e2b08f14be07c46b3fd9a516a64e9933fb Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2026 19:29:26 +0100 Subject: LWW everywhere, mostly --- src/remake/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/remake/mod.rs') 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 + 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(&self, f: F) -> impl Future> + 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 + Send; -- cgit v1.3.1