Skip to main content

HashToIndex

Trait HashToIndex 

Source
pub trait HashToIndex: Default + Clone {
    // Required methods
    fn hash_to_index(
        &self,
        hash_value: u64,
        table_capacity: PowerOfTwo32,
    ) -> usize;
    fn update_for_new_table_capacity(&mut self, table_capacity: PowerOfTwo32);
}
Expand description

This trait represents a strategy for converting hash values to indices in the bytell hash table.

Required Methods§

Source

fn hash_to_index(&self, hash_value: u64, table_capacity: PowerOfTwo32) -> usize

Converts a hash value to an index in the bytell hash table.

Source

fn update_for_new_table_capacity(&mut self, table_capacity: PowerOfTwo32)

Updates the hash-to-index policy when the table changes its capacity.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§