Trait TransitionLog
pub trait TransitionLog<T>: Send + Syncwhere
T: LinkReference,{
// Required methods
fn read_entries(&mut self) -> Result<Vec<JournalEntry<T>>, Error>;
fn append(&mut self, entry: &JournalEntry<T>) -> Result<(), Error>;
}Expand description
Storage for ordered transaction records.
A durable implementation must persist a complete record before append
succeeds, preserve append order, and reject corruption on read_entries.
An incomplete final append may be discarded. After an append error the
decorator blocks further writes until reopened, since durability is uncertain.
Use one exclusively owned journal for one exclusively owned store.
Required Methods§
fn read_entries(&mut self) -> Result<Vec<JournalEntry<T>>, Error>
fn read_entries(&mut self) -> Result<Vec<JournalEntry<T>>, Error>
Reads all complete records in append order.
fn append(&mut self, entry: &JournalEntry<T>) -> Result<(), Error>
fn append(&mut self, entry: &JournalEntry<T>) -> Result<(), Error>
Appends and, for durable implementations, synchronizes one record.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".