Trait openraft::testing::StoreBuilder

source ·
pub trait StoreBuilder<C, LS, SM, G = ()>: Send + Sync + Send{
    // Required method
    fn build(
        &self
    ) -> impl Future<Output = Result<(G, LS, SM), StorageError<C::NodeId>>> + Send;
}
Expand description

The trait to build a RaftLogStorage and RaftStateMachine implementation.

The generic parameter C is type config for a RaftLogStorage and RaftStateMachine implementation, LS is the type that implements RaftLogStorage, SM is the type that implements RaftStateMachine, and G is a guard type that cleanup resource when being dropped.

By default G is a trivial guard (). To test a store that is backed by a folder on disk, G could be the dropper of the temp-dir that stores data.

Required Methods§

source

fn build( &self ) -> impl Future<Output = Result<(G, LS, SM), StorageError<C::NodeId>>> + Send

Build a RaftLogStorage and RaftStateMachine implementation

Object Safety§

This trait is not object safe.

Implementors§