pub trait TransitionLogStore {
// Required methods
fn append_log_entry(&mut self, entry: &str) -> Result<(), LinkError>;
fn read_log_entries(&mut self) -> Result<Vec<String>, LinkError>;
fn flush_log(&mut self) -> Result<(), LinkError>;
// Provided methods
fn supports_durable_flush(&self) -> bool { ... }
fn supports_compaction(&self) -> bool { ... }
fn compact_log_entries(
&mut self,
entries: &[String],
) -> Result<(), LinkError> { ... }
}Expand description
Append-only store of serialized transitions and recovery markers.
Required Methods§
Sourcefn append_log_entry(&mut self, entry: &str) -> Result<(), LinkError>
fn append_log_entry(&mut self, entry: &str) -> Result<(), LinkError>
Appends one entry. Entries never contain newlines.
Provided Methods§
Sourcefn supports_durable_flush(&self) -> bool
fn supports_durable_flush(&self) -> bool
Whether flush requests persistent storage. Custom/volatile logs default to false; this describes an adapter, not the reliability of its hardware.
Sourcefn supports_compaction(&self) -> bool
fn supports_compaction(&self) -> bool
Whether compact_log_entries can rewrite
the durable journal. Retention uses it to bound the journal on disk;
logs without it keep every entry, as before.
Sourcefn compact_log_entries(&mut self, entries: &[String]) -> Result<(), LinkError>
fn compact_log_entries(&mut self, entries: &[String]) -> Result<(), LinkError>
Atomically and durably replaces every entry with entries, the
retained journal. After a crash the log holds either the old or the
new journal, never a mixture. Called only between transactions and
only when supports_compaction is true.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".