Struct std::collections::hash_map::raw_table::FullBucket [] [src]

pub struct FullBucket<K, V, M> {
    raw: RawBucket<K, V>,
    idx: usize,
    table: M,
}

Fields

raw
idx
table

Methods

impl<K, V, M> FullBucket<K, V, M>

fn table(&self) -> &M

Borrow a reference to the table.

fn into_table(self) -> M

Move out the reference to the table.

fn index(&self) -> usize

Get the raw index.

impl<K, V, M: Deref<Target=RawTable<K, V>>> FullBucket<K, V, M>

fn next(self) -> Bucket<K, V, M>

fn into_bucket(self) -> Bucket<K, V, M>

fn distance(&self) -> usize

Get the distance between this bucket and the 'ideal' location as determined by the key's hash stored in it.

In the cited blog posts above, this is called the "distance to initial bucket", or DIB. Also known as "probe count".

fn hash(&self) -> SafeHash

fn read(&self) -> (&K, &V)

Gets references to the key and value at a given index.

impl<K, V, M: Deref<Target=RawTable<K, V>> + DerefMut> FullBucket<K, V, M>

fn take(self) -> (EmptyBucket<K, V, M>, K, V)

Removes this bucket's key and value from the hashtable.

This works similarly to put, building an EmptyBucket out of the taken bucket.

fn replace(&mut self, h: SafeHash, k: K, v: V) -> (SafeHash, K, V)

fn read_mut(&mut self) -> (&mut K, &mut V)

Gets mutable references to the key and value at a given index.

impl<'t, K, V, M: Deref<Target=RawTable<K, V>> + 't> FullBucket<K, V, M>

fn into_refs(self) -> (&'t K, &'t V)

Exchange a bucket state for immutable references into the table. Because the underlying reference to the table is also consumed, no further changes to the structure of the table are possible; in exchange for this, the returned references have a longer lifetime than the references returned by read().

impl<'t, K, V, M: Deref<Target=RawTable<K, V>> + DerefMut + 't> FullBucket<K, V, M>

fn into_mut_refs(self) -> (&'t mut K, &'t mut V)

This works similarly to into_refs, exchanging a bucket state for mutable references into the table.