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§
Sourcefn propose(
&self,
command: CommandEnvelope,
control: &ExecutionControl,
) -> Result<CommitReceipt, LogError>
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.
Sourcefn read_committed(
&self,
after: LogPosition,
limit: usize,
) -> Result<Vec<CommittedEntry>, LogError>
fn read_committed( &self, after: LogPosition, limit: usize, ) -> Result<Vec<CommittedEntry>, LogError>
Reads committed entries strictly after after, in log order.
Sourcefn applied_position(&self) -> LogPosition
fn applied_position(&self) -> LogPosition
The highest position the local state machine has applied.
Sourcefn create_snapshot(&self) -> Result<LogSnapshot, LogError>
fn create_snapshot(&self) -> Result<LogSnapshot, LogError>
Captures applied state through the current applied position.
Sourcefn install_snapshot(&self, snapshot: LogSnapshot) -> Result<(), LogError>
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".