[−][src]Struct hash_ring::HashRing
HashRing
Implementations
impl<T: ToString + Clone> HashRing<T, BuildHasherDefault<XxHash64>>
[src]
pub fn new(
nodes: Vec<T>,
replicas: isize
) -> HashRing<T, BuildHasherDefault<XxHash64>>
[src]
nodes: Vec<T>,
replicas: isize
) -> HashRing<T, BuildHasherDefault<XxHash64>>
Creates a new hash ring with the specified nodes. Replicas is the number of virtual nodes each node has to make a better distribution.
impl<T, S> HashRing<T, S> where
T: ToString + Clone,
S: BuildHasher,
[src]
T: ToString + Clone,
S: BuildHasher,
pub fn with_hasher(
nodes: Vec<T>,
replicas: isize,
hash_builder: S
) -> HashRing<T, S>
[src]
nodes: Vec<T>,
replicas: isize,
hash_builder: S
) -> HashRing<T, S>
pub fn add_node(&mut self, node: &T)
[src]
Adds a node to the hash ring
pub fn remove_node(&mut self, node: &T)
[src]
Deletes a node from the hash ring
pub fn get_node(&self, key: String) -> Option<&T>
[src]
Gets the node a specific key belongs to
Auto Trait Implementations
impl<T, S> RefUnwindSafe for HashRing<T, S> where
S: RefUnwindSafe,
T: RefUnwindSafe,
[src]
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, S> Send for HashRing<T, S> where
S: Send,
T: Send,
[src]
S: Send,
T: Send,
impl<T, S> Sync for HashRing<T, S> where
S: Sync,
T: Sync,
[src]
S: Sync,
T: Sync,
impl<T, S> Unpin for HashRing<T, S> where
S: Unpin,
T: Unpin,
[src]
S: Unpin,
T: Unpin,
impl<T, S> UnwindSafe for HashRing<T, S> where
S: UnwindSafe,
T: UnwindSafe,
[src]
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,