Struct openraft_memstore::MemStore
source · pub struct MemStore { /* private fields */ }
Expand description
An in-memory storage system implementing the RaftStorage
trait.
Implementations§
source§impl MemStore
impl MemStore
pub async fn new_async() -> Arc<Self>
sourcepub async fn drop_snapshot(&self)
pub async fn drop_snapshot(&self)
Remove the current snapshot.
This method is only used for testing purposes.
sourcepub async fn get_state_machine(&self) -> MemStoreStateMachine
pub async fn get_state_machine(&self) -> MemStoreStateMachine
Get a handle to the state machine for testing purposes.
sourcepub async fn clear_state_machine(&self)
pub async fn clear_state_machine(&self)
Clear the state machine for testing purposes.
sourcepub fn set_blocking(&self, block: BlockOperation, d: Duration)
pub fn set_blocking(&self, block: BlockOperation, d: Duration)
Block an operation for testing purposes.
sourcepub fn get_blocking(&self, block: &BlockOperation) -> Option<Duration>
pub fn get_blocking(&self, block: &BlockOperation) -> Option<Duration>
Get the blocking flag for an operation.
sourcepub fn clear_blocking(&mut self, block: BlockOperation)
pub fn clear_blocking(&mut self, block: BlockOperation)
Clear a blocking flag for an operation.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MemStore
impl !RefUnwindSafe for MemStore
impl Send for MemStore
impl Sync for MemStore
impl Unpin for MemStore
impl UnwindSafe for MemStore
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