Skip to main content

CommitLog

Trait CommitLog 

Source
pub trait CommitLog: Send + Sync {
    // Required methods
    fn propose(
        &self,
        command: CommandEnvelope,
        control: &ExecutionControl,
    ) -> Result<CommitReceipt, LogError>;
    fn read_committed(
        &self,
        after: LogPosition,
        limit: usize,
    ) -> Result<Vec<CommittedEntry>, LogError>;
    fn applied_position(&self) -> LogPosition;
    fn create_snapshot(&self) -> Result<LogSnapshot, LogError>;
    fn install_snapshot(&self, snapshot: LogSnapshot) -> Result<(), LogError>;
}
Expand description

The single authority through which commands become committed.

Required Methods§

Source

fn propose( &self, command: CommandEnvelope, control: &ExecutionControl, ) -> Result<CommitReceipt, LogError>

Proposes one command and waits until its durability policy is satisfied. A returned CommitReceipt is irrevocable.

Source

fn read_committed( &self, after: LogPosition, limit: usize, ) -> Result<Vec<CommittedEntry>, LogError>

Reads committed entries strictly after after, in log order.

Source

fn applied_position(&self) -> LogPosition

The highest position the local state machine has applied.

Source

fn create_snapshot(&self) -> Result<LogSnapshot, LogError>

Captures applied state through the current applied position.

Source

fn install_snapshot(&self, snapshot: LogSnapshot) -> Result<(), LogError>

Replaces applied state with a snapshot taken at a log boundary.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§