Skip to main content

ReplicationControl

Trait ReplicationControl 

Source
pub trait ReplicationControl: Sync + Send {
    type Command: Send;
    type State: Send;

    // Required methods
    fn replication_state(&self) -> Self::State;
    fn apply_replication(
        &mut self,
        command: Self::Command,
    ) -> impl Future<Output = Result<Self::State, StoreError>> + Send;
}
Expand description

Replication control capability with implementation-owned command and state values.

Required Associated Types§

Source

type Command: Send

Value type used for command.

Source

type State: Send

Value type used for state.

Required Methods§

Source

fn replication_state(&self) -> Self::State

Returns current replication state.

Source

fn apply_replication( &mut self, command: Self::Command, ) -> impl Future<Output = Result<Self::State, StoreError>> + Send

Applies one replication command.

§Errors

Returns StoreError with crate::StoreOperation::Replicate when the replication operation fails.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§