diff options
| author | tv <tv@krebsco.de> | 2026-11-01 19:29:26 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-01 19:29:26 +0100 |
| commit | a9838a756fa7730e887598592a2f1b5b294e68a7 (patch) | |
| tree | aa1f75eafadd7e89a6b5679fc10a918bad55ac03 /src/remake/mod.rs | |
| parent | 75f34a6b1c1c77e92aaf95f3ddb0751b190a9fce (diff) | |
LWW everywhere, mostly
Diffstat (limited to 'src/remake/mod.rs')
| -rw-r--r-- | src/remake/mod.rs | 12 |
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; |
