Skip to main content

InMemoryCommitLog

Struct InMemoryCommitLog 

Source
pub struct InMemoryCommitLog { /* private fields */ }
Expand description

Thread-safe in-memory CommitLog; see the module documentation.

Implementations§

Source§

impl InMemoryCommitLog

Source

pub fn new() -> Self

Creates an empty log whose commit timestamps come from the system clock in microseconds (logical and node_tiebreaker are zero).

Source

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

Source§

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>

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.
Source§

impl Debug for InMemoryCommitLog

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InMemoryCommitLog

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.