Trait 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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§