Struct perfect_hash::PerfectHasher8
source · pub struct PerfectHasher8<C, H> { /* private fields */ }
Implementations
sourceimpl<C> PerfectHasher8<C, DefaultHasher>
impl<C> PerfectHasher8<C, DefaultHasher>
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> PerfectHasher8<C, H>where
H: Hasher,
C: Hash + Ord,
impl<C, H> PerfectHasher8<C, H>where
H: Hasher,
C: Hash + Ord,
pub fn with_hasher(hasher: H) -> Self
pub fn with_capacity(capacity: u8) -> PerfectHasher8<C, DefaultHasher>
pub fn with_capacity_and_hasher(capacity: u8, hasher: H) -> Self
pub fn unique_id(&mut self, content: C) -> Id<u8>
pub fn get(&self, id: u8) -> Option<&C>
pub fn dissociate(&mut self, id: Id<u8>)
Trait Implementations
Auto Trait Implementations
impl<C, H> RefUnwindSafe for PerfectHasher8<C, H>where
C: RefUnwindSafe,
H: RefUnwindSafe,
impl<C, H> Send for PerfectHasher8<C, H>where
C: Send,
H: Send,
impl<C, H> Sync for PerfectHasher8<C, H>where
C: Sync,
H: Sync,
impl<C, H> Unpin for PerfectHasher8<C, H>where
C: Unpin,
H: Unpin,
impl<C, H> UnwindSafe for PerfectHasher8<C, H>where
C: UnwindSafe,
H: 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