[][src]Struct hat_trie::DenseVecTrieNode

pub struct DenseVecTrieNode<K, V> where
    K: AsPrimitive<usize> + Bounded + Copy + Debug + Hash + FromPrimitive + PartialEq + PartialOrd + Sized + Unsigned,
    Box<[K]>: Clone + PartialEq,
    V: Clone + Debug + Default
{ /* fields omitted */ }

A type of Trie that implemented by using Vec index as encoded key.

Care should be taken before using this Trie.

The memory requirement for this Trie is equals to bits of key. For example, if key is of type &u8, each layer of Trie will need at least 2^8 * 4 bytes (1024 bytes) + all other meta such as minimum and maximum length of stored key, threshold for burst/split, etc. If key is of type &u32, each layer will need 2^32 * 4 bytes (16GB).

Implementations

impl<K, V> DenseVecTrieNode<K, V> where
    K: Copy + AsPrimitive<usize> + Bounded + Debug + Hash + FromPrimitive + PartialEq + PartialOrd + Sized + Unsigned,
    Box<[K]>: Clone + PartialEq,
    V: Clone + Debug + Default
[src]

pub fn new() -> DenseVecTrieNode<K, V>[src]

Create new empty DenseVecTrieNode.

It will automatically expand into larger trie by append necesseary child type to maintain it fitness. This method return default configuration for the DenseVecTrieNode.

pub fn with_spec(
    threshold: usize,
    init_bucket_size: usize,
    init_bucket_slots: usize,
    bucket_load_factor: usize
) -> DenseVecTrieNode<K, V>
[src]

Create new empty DenseVecTrieNode.

It will automatically expand into larger trie by append necesseary child type to maintain it fitness. This method take specifications which this trie should maintain in order to fit with expected performance.

Parameters

threshold - The number of element in each leaf container which if exceed will cause node burst/split depending on type of node at that moment. init_bucket_size - The initial size of bucket. Bucket is a container used in leaf node. This number shall be large enough to have only few data in each slot in bucket but it shall also be small enough to fit into single page of memory for caching reason. init_bucket_slots - The initial size of each slot which will store actual data. It will grow if there is a lot of hash collision. bucket_load_factor - The number of element in bucket which if reached, will expand the bucket size by 2 times of current size.

Return

A trie instance of type DenseVecTrieNode

Trait Implementations

impl<K: Clone, V: Clone> Clone for DenseVecTrieNode<K, V> where
    K: AsPrimitive<usize> + Bounded + Copy + Debug + Hash + FromPrimitive + PartialEq + PartialOrd + Sized + Unsigned,
    Box<[K]>: Clone + PartialEq,
    V: Clone + Debug + Default
[src]

impl<K: Debug, V: Debug> Debug for DenseVecTrieNode<K, V> where
    K: AsPrimitive<usize> + Bounded + Copy + Debug + Hash + FromPrimitive + PartialEq + PartialOrd + Sized + Unsigned,
    Box<[K]>: Clone + PartialEq,
    V: Clone + Debug + Default
[src]

impl<K, V> TrieNode<K, V> for DenseVecTrieNode<K, V> where
    K: AsPrimitive<usize> + Bounded + Copy + Debug + Hash + FromPrimitive + PartialEq + PartialOrd + Sized + Unsigned,
    Box<[K]>: Clone + PartialEq,
    V: Clone + Debug + Default
[src]

Auto Trait Implementations

impl<K, V> RefUnwindSafe for DenseVecTrieNode<K, V> where
    K: RefUnwindSafe,
    V: RefUnwindSafe

impl<K, V> Send for DenseVecTrieNode<K, V> where
    V: Send

impl<K, V> !Sync for DenseVecTrieNode<K, V>

impl<K, V> Unpin for DenseVecTrieNode<K, V> where
    K: Unpin,
    V: Unpin

impl<K, V> UnwindSafe for DenseVecTrieNode<K, V> where
    K: RefUnwindSafe + UnwindSafe,
    V: RefUnwindSafe + UnwindSafe

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,