[−][src]Struct ahtable::ArrayHashBuilder
A builder that use for build an ArrayHash.
Implementations
impl<H> ArrayHashBuilder<H> where
H: Hasher,
[src]
H: Hasher,
pub fn with_hasher(hasher: H) -> ArrayHashBuilder<H>
[src]
Create new ArrayHashBuilder by using given hasher. As currently is, the default allocated number of slot per bucket is (4096 / size of usize) slots.
Since all slots are Vec, it will be re-allocate if it grow larger than this default. However, number of slots per bucket will be constant. It will never grow pass this number.
pub fn hasher<H2>(self, hasher: H2) -> ArrayHashBuilder<H2>
[src]
Switch hasher to other hasher. This will consume current builder and return a new one with new builder
pub fn buckets_size(self, size: usize) -> Self
[src]
Change buckets size of ArrayHasher. Buckets size will remain constant throughout entire lifecycle of it.
pub fn max_load_factor(self, factor: usize) -> Self
[src]
Change max number of entry before double the buckets size.
pub fn slot_size(self, size: usize) -> Self
[src]
Default initialized slot size. Every slot in bucket will be
allocated by given size.
Keep in mind that each slot is a vec
. It can grow pass this
number. It'd be best to give a proper estimation to prevent unnecessary
re-allocation.
pub fn build<K, V>(self) -> ArrayHash<H, K, V> where
H: Hasher + Clone,
K: Hash + PartialEq + Clone,
V: Clone,
[src]
H: Hasher + Clone,
K: Hash + PartialEq + Clone,
V: Clone,
Consume this builder and construct a new ArrayHash
Trait Implementations
impl Default for ArrayHashBuilder<XxHash64>
[src]
Create new ArrayHashBuilder with default hasher and size.
As currently is, the default allocated number of slot per bucket is (4096 / size of usize) slots.
Each slot has 8 elements. It will use XxHash64
as default hasher
Since all slots are Vec, it will be re-allocate if it grow larger than this default.
The number of slots per bucket will be held until the number of entry grew pass max_load_factor
.
When it reach the max_load_factor
, it will double the bucket size.
fn default() -> ArrayHashBuilder<XxHash64>
[src]
Auto Trait Implementations
impl<H> RefUnwindSafe for ArrayHashBuilder<H> where
H: RefUnwindSafe,
H: RefUnwindSafe,
impl<H> Send for ArrayHashBuilder<H> where
H: Send,
H: Send,
impl<H> Sync for ArrayHashBuilder<H> where
H: Sync,
H: Sync,
impl<H> Unpin for ArrayHashBuilder<H> where
H: Unpin,
H: Unpin,
impl<H> UnwindSafe for ArrayHashBuilder<H> where
H: UnwindSafe,
H: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> 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, U> TryInto<U> 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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,