pub struct ConsistentHash<K, V> {
pub user_keys: Vec<K>,
/* private fields */
}
Fields§
§user_keys: Vec<K>
Implementations§
Source§impl<K: Hash + Ord, V: Evict + Clone> ConsistentHash<K, V>
impl<K: Hash + Ord, V: Evict + Clone> ConsistentHash<K, V>
pub fn new(replicas: i32) -> Result<ConsistentHash<K, V>, String>
pub fn print_node(&self)
pub fn add_node(&mut self, key: K, value: V) -> Result<(), String>
pub fn get_node(&self, name: &K) -> Option<&V>
pub fn get_mut_node(&mut self, name: &K) -> Option<&mut V>
pub fn delete_node(&mut self, name: &K) -> Result<(), String>
pub fn search_nearest(&self, name: u128) -> Option<u128>
Auto Trait Implementations§
impl<K, V> Freeze for ConsistentHash<K, V>
impl<K, V> RefUnwindSafe for ConsistentHash<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for ConsistentHash<K, V>
impl<K, V> Sync for ConsistentHash<K, V>
impl<K, V> Unpin for ConsistentHash<K, V>
impl<K, V> UnwindSafe for ConsistentHash<K, V>where
V: UnwindSafe,
K: UnwindSafe,
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