ketama-hash-ring 11.1.0

Zero-dependency consistent hashing suite implementing Jump Consistent Hash, weighted Ketama virtual-node rings, and Google Maglev O(1) lookup tables.
Documentation
/// One physical node entry stored in a [`ConsistentHashRing`].
#[derive(Clone, Debug, Eq, PartialEq)]
pub(crate) struct RingNode<N> {
    /// Unique stable identifier used to hash virtual replicas.
    pub(crate) id: String,
    /// Relative weight (`>= 1`) scaling virtual node count.
    pub(crate) weight: usize,
    /// User-supplied node value.
    pub(crate) value: N,
}

/// Weighted Ketama virtual-node consistent hash ring with O(log V) binary search.
#[derive(Clone, Debug)]
pub struct ConsistentHashRing<N> {
    /// Virtual nodes per unit of weight.
    pub(crate) virtual_nodes: usize,
    /// Physical nodes indexed by compact `usize`.
    pub(crate) nodes: Vec<RingNode<N>>,
    /// Sorted `(point_hash, node_index)` ring entries.
    pub(crate) ring: Vec<(u64, usize)>,
}