[−][src]Struct maglev_rs::Maglev
! # Maglev ! An implementation of the maglev consistent hashing algorithm
Implementations
impl Maglev
[src]
pub fn new(backends: &Vec<String>, table_size: u64) -> Result<Maglev, &str>
[src]
Creates a new hash table of table_size with given backends. The backend size should be a prime, else returns an error
pub fn get_backend(&self, idx: usize) -> Option<String>
[src]
Get backend for a given index
pub fn put_backend(&mut self, backend: &String) -> Result<(), &str>
[src]
Add a backend to the list. Regenerates the hashing table
pub fn remove_backend(&mut self, backend: &String) -> Result<(), &str>
[src]
Remove a backend to the list. Regenerates the hashing table
Trait Implementations
impl Debug for Maglev
[src]
impl PartialEq<Maglev> for Maglev
[src]
impl StructuralPartialEq for Maglev
[src]
Auto Trait Implementations
impl RefUnwindSafe for Maglev
[src]
impl Send for Maglev
[src]
impl Sync for Maglev
[src]
impl Unpin for Maglev
[src]
impl UnwindSafe for Maglev
[src]
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>,