Struct odht::HashTable[][src]

pub struct HashTable<C: Config, D: Borrow<[u8]>> { /* fields omitted */ }
Expand description

The HashTable type provides a cheap way to construct a non-resizable view of a persisted hash table. If the underlying data storage D implements BorrowMut<[u8]> then the table can be modified in place.

Implementations

Constructs a HashTable from its raw byte representation. The provided data must have the exact right number of bytes.

This method has constant time complexity and will only verify the header data of the hash table. It will not copy any data.

Constructs a HashTable from its raw byte representation without doing any verification of the underlying data. It is the user’s responsibility to make sure that the underlying data is actually a valid hash table.

The HashTable::from_raw_bytes method provides a safe alternative to this method.

Returns the number of items stored in the hash table.

Inserts the given key-value pair into the table. Unlike HashTableOwned::insert this method cannot grow the underlying table if there is not enough space for the new item. Instead the call will panic.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.