RingHasherTrait

Trait RingHasherTrait 

Source
pub trait RingHasherTrait {
    // Required method
    fn digest(&self, data: &str) -> Result<u64>;
}
Expand description

A trait that defines the behavior of a hashing function used in the consistent hashing ring.

Implementors of this trait must provide a digest method that takes a string input and returns a 64-bit hash value. This hash value is used to determine the placement of keys and nodes in the consistent hashing ring.

Required Methods§

Source

fn digest(&self, data: &str) -> Result<u64>

Computes a 64-bit hash value for the given input string.

§Arguments
  • data: The input string to hash.
§Returns
  • Result<u64>: The computed hash value or an error if the hashing fails.

Implementors§