ProcessorTransactionLogFactory

Trait ProcessorTransactionLogFactory 

Source
pub trait ProcessorTransactionLogFactory:
    Send
    + Sync
    + 'static {
    // Required methods
    fn read(
        &self,
    ) -> Pin<Box<dyn ConditionalSendFuture<Output = Result<Vec<LogEntry>, BevyError>> + '_>>;
    fn create_new_log(
        &self,
    ) -> Pin<Box<dyn ConditionalSendFuture<Output = 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§

Source

fn read( &self, ) -> Pin<Box<dyn ConditionalSendFuture<Output = 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.

Source

fn create_new_log( &self, ) -> Pin<Box<dyn ConditionalSendFuture<Output = Result<Box<dyn ProcessorTransactionLog>, BevyError>> + '_>>

Creates a new transaction log to write to.

This should remove any previous entries if they exist.

Implementors§