[−][src]Struct perfect_hash::PerfectHasher
Methods
impl<C> PerfectHasher<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> PerfectHasher<C, H> where
H: Hasher,
C: Hash + Ord,
[src]
H: Hasher,
C: Hash + Ord,
pub fn with_hasher(hasher: H) -> Self
[src]
pub fn with_capacity(capacity: usize) -> PerfectHasher<C, DefaultHasher>
[src]
pub fn with_capacity_and_hasher(capacity: usize, hasher: H) -> Self
[src]
pub fn unique_id(&mut self, content: C) -> Id<usize>
[src]
pub fn get(&self, id: usize) -> Option<&C>
[src]
ⓘImportant traits for Contents<'l, I, C, H>pub fn contents<'i, I>(&self, ids: I) -> Contents<I, C, H> where
I: Iterator<Item = &'i Id<usize>>,
[src]
ⓘImportant traits for Contents<'l, I, C, H>
I: Iterator<Item = &'i Id<usize>>,
Returns an Iterator
of content associated with the ids from ids
Iterator
.
Trait Implementations
impl<C, H> Default for PerfectHasher<C, H> where
H: Hasher + Default,
C: Hash + Ord,
[src]
H: Hasher + Default,
C: Hash + Ord,
fn default() -> PerfectHasher<C, H>
[src]
impl<C, H> Index<Id<usize>> for PerfectHasher<C, H>
[src]
Auto Trait Implementations
impl<C, H> Send for PerfectHasher<C, H> where
C: Send,
H: Send,
C: Send,
H: Send,
impl<C, H> Sync for PerfectHasher<C, H> where
C: Sync,
H: Sync,
C: Sync,
H: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,