pub trait ProcessorTransactionLogFactory:
Send
+ Sync
+ 'static {
// Required methods
fn read(&self) -> BoxedFuture<'_, Result<Vec<LogEntry>, BevyError>>;
fn create_new_log(
&self,
) -> BoxedFuture<'_, Result<Box<dyn ProcessorTransactionLog>, BevyError>>;
}Expand description
A factory of ProcessorTransactionLog that handles the state before the log has been started.
This trait also assists in recovering from partial processing by fetching the previous state of the transaction log.
Required Methods§
Sourcefn read(&self) -> BoxedFuture<'_, Result<Vec<LogEntry>, BevyError>>
fn read(&self) -> BoxedFuture<'_, Result<Vec<LogEntry>, BevyError>>
Reads all entries in a previous transaction log if present.
If there is no previous transaction log, this method should return an empty Vec of entries.
Sourcefn create_new_log(
&self,
) -> BoxedFuture<'_, Result<Box<dyn ProcessorTransactionLog>, BevyError>>
fn create_new_log( &self, ) -> BoxedFuture<'_, Result<Box<dyn ProcessorTransactionLog>, BevyError>>
Creates a new transaction log to write to.
This should remove any previous entries if they exist.