Struct consistent_rs::Consistant
[−]
[src]
pub struct Consistant { pub replicas_num: usize, // some fields omitted }
Consistant holds the information of the hash ring.
Fields
replicas_num: usize
Methods
impl Consistant
[src]
fn new(replicas_num: usize) -> Self
Crete a new instance of Consistant.
fn count(&self) -> usize
Get the count of added elements.
fn add<S: Into<String>>(&mut self, element: S)
Add an elment to the hash ring.
fn get<S: Into<String>>(&self, name: S) -> Option<String>
Get the cloeset element's name to the given "name".
fn get_n<S: Into<String>>(&self, name: S, n: usize) -> Option<Vec<String>>
Get the N cloeset elements' names to the given "name".
fn remove<S: Into<String>>(&mut self, name: S)
Remove the given element.
Trait Implementations
impl Debug for Consistant
[src]
impl Default for Consistant
[src]
fn default() -> Consistant
Returns the "default value" for a type. Read more