pub struct Maglev<N, S = BuildHasherDefault<DefaultHasher>> { /* private fields */ }
Expand description
Maglev lookup table
Implementations§
Source§impl<N: Hash + Eq> Maglev<N, BuildHasherDefault<DefaultHasher>>
impl<N: Hash + Eq> Maglev<N, BuildHasherDefault<DefaultHasher>>
Sourcepub fn new<I: IntoIterator<Item = N>>(nodes: I) -> Self
pub fn new<I: IntoIterator<Item = N>>(nodes: I) -> Self
Creates a Maglev
lookup table.
Sourcepub fn with_capacity<I: IntoIterator<Item = N>>(
nodes: I,
capacity: usize,
) -> Self
pub fn with_capacity<I: IntoIterator<Item = N>>( nodes: I, capacity: usize, ) -> Self
Creates a Maglev
lookup table with the specified capacity.
Source§impl<N: Hash + Eq, S: BuildHasher> Maglev<N, S>
impl<N: Hash + Eq, S: BuildHasher> Maglev<N, S>
Sourcepub fn with_hasher<I: IntoIterator<Item = N>>(nodes: I, hash_builder: S) -> Self
pub fn with_hasher<I: IntoIterator<Item = N>>(nodes: I, hash_builder: S) -> Self
Creates a Maglev
lookup table which will use the given hash builder to hash keys.
Sourcepub fn with_capacity_and_hasher<I: IntoIterator<Item = N>>(
nodes: I,
capacity: usize,
hash_builder: S,
) -> Self
pub fn with_capacity_and_hasher<I: IntoIterator<Item = N>>( nodes: I, capacity: usize, hash_builder: S, ) -> Self
Creates a Maglev
lookup table with the specified capacity, using hasher to hash the keys.
Trait Implementations§
Source§impl<N, S> ConsistentHasher<N> for Maglev<N, S>
impl<N, S> ConsistentHasher<N> for Maglev<N, S>
Source§impl<N: Hash + Eq> FromIterator<N> for Maglev<N, BuildHasherDefault<DefaultHasher>>
impl<N: Hash + Eq> FromIterator<N> for Maglev<N, BuildHasherDefault<DefaultHasher>>
Source§fn from_iter<T: IntoIterator<Item = N>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = N>>(iter: T) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl<N, S> Freeze for Maglev<N, S>where
S: Freeze,
impl<N, S> RefUnwindSafe for Maglev<N, S>where
S: RefUnwindSafe,
N: RefUnwindSafe,
impl<N, S> Send for Maglev<N, S>
impl<N, S> Sync for Maglev<N, S>
impl<N, S> Unpin for Maglev<N, S>
impl<N, S> UnwindSafe for Maglev<N, S>where
S: UnwindSafe,
N: 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