Struct hash_ring::HashRing
[−]
[src]
pub struct HashRing<T> { /* fields omitted */ }
HashRing
Methods
impl<T: ToString + Clone> HashRing<T>
[src]
fn new(nodes: Vec<T>, replicas: isize) -> HashRing<T>
[src]
Creates a new hash ring with the specified nodes. Replicas is the number of virtual nodes each node has to make a better distribution.
fn add_node(&mut self, node: &T)
[src]
Adds a node to the hash ring
fn remove_node(&mut self, node: &T)
[src]
Deletes a node from the hash ring
fn get_node(&mut self, key: String) -> Option<&T>
[src]
Gets the node a specific key belongs to