Trait scylla::transport::partitioner::Partitioner

source ·
pub trait Partitioner {
    type Hasher: PartitionerHasher;

    // Required method
    fn build_hasher(&self) -> Self::Hasher;

    // Provided method
    fn hash_one(&self, data: &[u8]) -> Token { ... }
}
Expand description

A trait for creating instances of PartitionHasher, which ultimately compute the token.

The Partitioners’ design is based on std::hash design: Partitioner corresponds to HasherBuilder, and PartitionerHasher to Hasher. See their documentation for more details.

Required Associated Types§

Required Methods§

source

fn build_hasher(&self) -> Self::Hasher

Provided Methods§

source

fn hash_one(&self, data: &[u8]) -> Token

Implementors§