[][src]Trait rendezvous_hash::Node

pub trait Node {
    type NodeId: Hash + PartialEq + Ord;
    type HashCode: Ord;
    fn node_id(&self) -> &Self::NodeId;
fn hash_code<H, U: Hash>(&self, hasher: &H, item: &U) -> Self::HashCode
    where
        H: NodeHasher<Self::NodeId>
; }

This trait represents a candidate node for rendezvous.

Associated Types

type NodeId: Hash + PartialEq + Ord

Node identifier type.

type HashCode: Ord

Hash code type.

Loading content...

Required methods

fn node_id(&self) -> &Self::NodeId

Returns the identifier of this node.

fn hash_code<H, U: Hash>(&self, hasher: &H, item: &U) -> Self::HashCode where
    H: NodeHasher<Self::NodeId>, 

Returns the hash code for the combination of thid node and item.

Note that the time complexity of this function should be constant.

Loading content...

Implementations on Foreign Types

impl<'_, T: Node> Node for &'_ T[src]

type NodeId = T::NodeId

type HashCode = T::HashCode

impl<'a> Node for &'a str[src]

type NodeId = Self

type HashCode = u64

Loading content...

Implementors

impl<K, V> Node for KeyValueNode<K, V> where
    K: Hash + PartialEq + Ord
[src]

type NodeId = K

type HashCode = u64

impl<N: Node> Node for WeightedNode<N>[src]

type NodeId = N::NodeId

type HashCode = SignPositiveF64

impl<T> Node for IdNode<T> where
    T: Hash + PartialEq + Ord
[src]

type NodeId = T

type HashCode = u64

Loading content...