pub trait ReplayMachine: Send {
// Required methods
fn replay(
&mut self,
item_batch: LogItemBatch,
file_id: FileId,
) -> Result<()>;
fn merge(&mut self, rhs: Self, queue: LogQueue) -> Result<()>;
}
Expand description
ReplayMachine
is a type of deterministic state machine that obeys
associative law.
Sequentially arranged log items can be divided and replayed to several
ReplayMachine
s, and their merged state will be the same as when
replayed to one single ReplayMachine
.
This abstraction is useful for recovery in parallel: a set of log files can be replayed in a divide-and-conquer fashion.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.