[][src]Struct memstore::MemStore

pub struct MemStore { /* fields omitted */ }

An in-memory storage system implementing the async_raft::RaftStorage trait.

Implementations

impl MemStore[src]

pub fn new(id: NodeId) -> Self[src]

Create a new MemStore instance.

pub async fn get_log(
    &self
) -> RwLockWriteGuard<'_, BTreeMap<u64, Entry<ClientRequest>>>
[src]

Get a handle to the log for testing purposes.

pub async fn get_state_machine(
    &self
) -> RwLockWriteGuard<'_, MemStoreStateMachine>
[src]

Get a handle to the state machine for testing purposes.

pub async fn read_hard_state(&self) -> RwLockReadGuard<'_, Option<HardState>>[src]

Get a handle to the current hard state for testing purposes.

Trait Implementations

impl RaftStorage<ClientRequest, ClientResponse> for MemStore[src]

type Snapshot = Cursor<Vec<u8>>

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

type ShutdownError = ShutdownError

The error type used to indicate to Raft that shutdown is needed when calling the apply_entry_to_state_machine method. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]