Skip to main content

PartitionedState

Trait PartitionedState 

Source
pub trait PartitionedState<C, R>: Debug + Send {
    // Required methods
    fn split_command(&mut self, command: C) -> Vec<Option<C>>;
    fn absorb_response(
        &mut self,
        shard_id: usize,
        response: R,
    ) -> Option<Result<R, Error>>;
}
Expand description

A state machine for a partitioned client that partitions commands across and amalgamates responses from multiple partitions.

Required Methods§

Source

fn split_command(&mut self, command: C) -> Vec<Option<C>>

Splits a command into multiple partitions.

Source

fn absorb_response( &mut self, shard_id: usize, response: R, ) -> Option<Result<R, Error>>

Absorbs a response from a single partition.

If responses from all partitions have been absorbed, returns an amalgamated response.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§