Skip to main content

DirectWritableKeyValueStore

Trait DirectWritableKeyValueStore 

Source
pub trait DirectWritableKeyValueStore:
    WithError
    + Send
    + Sync {
    type Batch: SimplifiedBatch + Serialize + DeserializeOwned + Default;

    const MAX_BATCH_SIZE: usize;
    const MAX_BATCH_TOTAL_SIZE: usize;
    const MAX_VALUE_SIZE: usize;

    // Required method
    fn write_batch(
        &self,
        batch: Self::Batch,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send + Sync;
}
Expand description

Asynchronous direct write key-value operations with simplified batch.

Some backend cannot implement WritableKeyValueStore directly and will require journaling.

Required Associated Constants§

Source

const MAX_BATCH_SIZE: usize

The maximal number of items in a batch.

Source

const MAX_BATCH_TOTAL_SIZE: usize

The maximal number of bytes of a batch.

Source

const MAX_VALUE_SIZE: usize

The maximal size of values that can be stored.

Required Associated Types§

Required Methods§

Source

fn write_batch( &self, batch: Self::Batch, ) -> impl Future<Output = Result<(), Self::Error>> + Send + Sync

Writes the batch to the database.

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§

Source§

impl DirectWritableKeyValueStore for DynamoDbStoreInternal

Source§

const MAX_BATCH_SIZE: usize = MAX_TRANSACT_WRITE_ITEM_SIZE

Source§

const MAX_BATCH_TOTAL_SIZE: usize = MAX_TRANSACT_WRITE_ITEM_TOTAL_SIZE

Source§

const MAX_VALUE_SIZE: usize = VISIBLE_MAX_VALUE_SIZE

Source§

type Batch = SimpleUnorderedBatch

Source§

impl DirectWritableKeyValueStore for ScyllaDbStoreInternal

Source§

const MAX_BATCH_SIZE: usize = MAX_BATCH_SIZE

Source§

const MAX_BATCH_TOTAL_SIZE: usize = MAX_BATCH_TOTAL_SIZE

Source§

const MAX_VALUE_SIZE: usize = VISIBLE_MAX_VALUE_SIZE

Source§

type Batch = UnorderedBatch