Struct perfect_hash::PerfectHashMap32
source · pub struct PerfectHashMap32<C, H, T> { /* private fields */ }
Implementations
sourceimpl<C, T> PerfectHashMap32<C, DefaultHasher, T>
impl<C, T> PerfectHashMap32<C, DefaultHasher, T>
sourcepub fn new() -> Self
pub fn new() -> Self
If you are not worried about DDoS you should use a faster hasher.
Rust defaults to SipHash which is more DDoS resistant, but very slow.
I recommend the fasthash crate for a collection of faster hashing algorithms.
You should use with_hasher(hasher)
or default()
when you don’t need DDoS resistance.
sourceimpl<C, H, T> PerfectHashMap32<C, H, T>where
H: Hasher,
C: Hash + Ord,
impl<C, H, T> PerfectHashMap32<C, H, T>where
H: Hasher,
C: Hash + Ord,
pub fn with_hasher(hasher: H) -> Self
pub fn with_capacity(capacity: u32) -> PerfectHashMap32<C, DefaultHasher, T>
pub fn with_capacity_and_hasher(capacity: u32, hasher: H) -> Self
pub fn unique_id<F>(&mut self, content: C, data: T, modify: F) -> Id<u32>where
F: FnOnce(&mut T, &T),
pub fn index_mut(&mut self, id: Id<u32>) -> (&C, &mut T)
pub fn get_mut(&mut self, id: u32) -> Option<(&C, &mut T)>
pub fn dissociate(&mut self, id: Id<u32>)
Trait Implementations
Auto Trait Implementations
impl<C, H, T> RefUnwindSafe for PerfectHashMap32<C, H, T>where
C: RefUnwindSafe,
H: RefUnwindSafe,
T: RefUnwindSafe,
impl<C, H, T> Send for PerfectHashMap32<C, H, T>where
C: Send,
H: Send,
T: Send,
impl<C, H, T> Sync for PerfectHashMap32<C, H, T>where
C: Sync,
H: Sync,
T: Sync,
impl<C, H, T> Unpin for PerfectHashMap32<C, H, T>where
C: Unpin,
H: Unpin,
T: Unpin,
impl<C, H, T> UnwindSafe for PerfectHashMap32<C, H, T>where
C: UnwindSafe,
H: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more