pub struct MemStore { /* private fields */ }
Expand description

An in-memory storage system implementing the RaftStorage trait.

Implementations

Create a new MemStore instance. TODO(xp): creating a store should not require an id.

Go backwards through the log to find the most recent membership config <= upto_index.

Trait Implementations

The storage engine’s associated type used for exposing a snapshot for reading & writing. Read more

Get the latest membership config found in the log or in state machine. Read more

Get Raft’s state information from storage. Read more

Save Raft’s hard-state. Read more

Get a series of log entries from storage. Read more

Get a series of log entries from storage. Read more

source

fn try_get_log_entry<'life0, 'async_trait>(
    &'life0 self,
    log_index: u64
) -> Pin<Box<dyn Future<Output = Result<Option<Entry<ClientRequest>>, StorageError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Try to get an log entry. It does not return an error if in defensive mode and the log entry at log_index is not found. Read more

Returns the first log id in log. Read more

Returns the last log id in log. Read more

Returns the last applied log id which is recorded in state machine, and the last applied membership log id and membership config. Read more

Delete all logs in a range.

Append a payload of entries to the log. Read more

Apply the given payload of entries to the state machine. Read more

Build snapshot Read more

Create a new blank snapshot, returning a writable handle to the snapshot object. Read more

Install a snapshot which has finished streaming from the cluster leader. Read more

Get a readable handle to the current snapshot, along with its metadata. Read more

Get a handle to the state machine for testing purposes.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more