pub trait Replayable: 'static {
type Edit: Serialize + DeserializeOwned;
// Required methods
fn apply(&mut self, edit: Self::Edit);
fn snapshot(&self) -> Self::Edit;
fn filename_prefix() -> &'static str;
fn initial() -> Self;
}Required Associated Types§
Sourcetype Edit: Serialize + DeserializeOwned
type Edit: Serialize + DeserializeOwned
This atomic edit is serialized into the journal for later reconstruction via sequential replay.
Required Methods§
Sourcefn apply(&mut self, edit: Self::Edit)
fn apply(&mut self, edit: Self::Edit)
Apply another Self::Edit to the current state.
Sourcefn snapshot(&self) -> Self::Edit
fn snapshot(&self) -> Self::Edit
Calculate a new edit that can be used to reconstruct the current state. This is required to create the initial edit for file rotations.
Sourcefn filename_prefix() -> &'static str
fn filename_prefix() -> &'static str
This prefix is used to create new files for rotation internally.
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.