pub struct ConsistentHash { /* private fields */ }
Implementations§
Source§impl ConsistentHash
impl ConsistentHash
pub fn new() -> ConsistentHash
pub fn with_load_factor(load_factor: f64) -> ConsistentHash
pub fn add_node(&mut self, node: &Node, num_replicas: u32)
pub fn get_node(&self, key: String) -> Option<Node>
pub fn assign_key(&mut self, key: String)
pub fn remove_node(&mut self, name: String)
pub fn size(&self) -> usize
pub fn list_nodes(&self) -> Option<Vec<Node>>
Trait Implementations§
Source§impl Clone for ConsistentHash
impl Clone for ConsistentHash
Source§fn clone(&self) -> ConsistentHash
fn clone(&self) -> ConsistentHash
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ConsistentHash
impl RefUnwindSafe for ConsistentHash
impl Send for ConsistentHash
impl Sync for ConsistentHash
impl Unpin for ConsistentHash
impl UnwindSafe for ConsistentHash
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more