[][src]Struct perfect_hash::PerfectHasher8

pub struct PerfectHasher8<C, H> { /* fields omitted */ }

Methods

impl<C> PerfectHasher8<C, DefaultHasher>[src]

pub fn new() -> Self[src]

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.

impl<C, H> PerfectHasher8<C, H> where
    H: Hasher,
    C: Hash + Ord
[src]

pub fn with_hasher(hasher: H) -> Self[src]

pub fn with_capacity(capacity: u8) -> PerfectHasher8<C, DefaultHasher>[src]

pub fn with_capacity_and_hasher(capacity: u8, hasher: H) -> Self[src]

pub fn unique_id(&mut self, content: C) -> Id<u8>[src]

pub fn get(&self, id: u8) -> Option<&C>[src]

Important traits for ContentsU8<'l, I, C, H>
pub fn contents<'i, I>(&self, ids: I) -> ContentsU8<I, C, H> where
    I: Iterator<Item = &'i Id<u8>>, 
[src]

Returns an Iterator of content associated with the ids from ids Iterator.

Trait Implementations

impl<C, H> Default for PerfectHasher8<C, H> where
    H: Hasher + Default,
    C: Hash + Ord
[src]

impl<C, H> Index<Id<u8>> for PerfectHasher8<C, H>[src]

type Output = C

The returned type after indexing.

Auto Trait Implementations

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

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.