scylla::transport::partitioner

Trait 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§