pub struct InMemoryCommitLog { /* private fields */ }Expand description
Thread-safe in-memory CommitLog; see the module documentation.
Implementations§
Source§impl InMemoryCommitLog
impl InMemoryCommitLog
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates an empty log whose commit timestamps come from the system
clock in microseconds (logical and node_tiebreaker are zero).
Sourcepub fn with_timestamp_source(timestamp_source: TimestampSource) -> Self
pub fn with_timestamp_source(timestamp_source: TimestampSource) -> Self
Creates an empty log with an injectable commit-timestamp source.
Trait Implementations§
Source§impl CommitLog for InMemoryCommitLog
impl CommitLog for InMemoryCommitLog
Source§fn propose(
&self,
command: CommandEnvelope,
control: &ExecutionControl,
) -> Result<CommitReceipt, LogError>
fn propose( &self, command: CommandEnvelope, control: &ExecutionControl, ) -> Result<CommitReceipt, LogError>
Verifies the envelope, honors cancellation/deadline, then commits and applies the command in one step. The receipt’s transaction id is derived from the envelope’s command id (the idempotent-apply identifier).
Source§fn 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.Source§fn applied_position(&self) -> LogPosition
fn applied_position(&self) -> LogPosition
The highest position the local state machine has applied.
Source§fn create_snapshot(&self) -> Result<LogSnapshot, LogError>
fn create_snapshot(&self) -> Result<LogSnapshot, LogError>
Captures applied state through the current applied position.
Source§fn 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.
Source§impl Debug for InMemoryCommitLog
impl Debug for InMemoryCommitLog
Auto Trait Implementations§
impl !Freeze for InMemoryCommitLog
impl RefUnwindSafe for InMemoryCommitLog
impl Send for InMemoryCommitLog
impl Sync for InMemoryCommitLog
impl Unpin for InMemoryCommitLog
impl UnsafeUnpin for InMemoryCommitLog
impl UnwindSafe for InMemoryCommitLog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more