Module

std::collections::arena_map

source

Re-exported from alloc::collections::arena_map.

Hash maps and sets stored in a caller-owned arena.

Types

ArenaMapA hash map in an arena, its keys in insertion order: a Copy handle whose copies all name the same map.
MapStateWhat an ArenaMap's copies share, in the arena: its slots, its entries and its count.
EntryOne key inserted into an ArenaMap, with its value, whether it is still live, and its hash's low bits.
ArenaSetA set, in insertion order: an ArenaMap whose values say nothing.

Functions

entry_hashThe bits of a key's hash under seed an entry keeps.
slot_atSlot i of slots, read under cx; stops the program past the end.
set_slotSets slot i of slots to value under cx; stops the program past the end.
zero_slotsEvery slot emptied.
placePuts entry in the first empty slot from where hash starts probing.
slice_of_zeroscount zeros in one block of the arena.

Function declarations

fn entry_hashsource

forall K, C where HashIn[K, C].
fn entry_hash(&cx: C, key: K, seed: Seed) -> u32 { ... }

The bits of a key's hash under seed an entry keeps.

fn slot_atsource

forall 'k, C, R where Access[C -> 'k, R].
fn slot_at(&cx: C, slots: Slice[usize, 'k], i: usize) -> usize { ... }

Slot i of slots, read under cx; stops the program past the end. Used by ArenaMap; not meant for direct use.

fn set_slotsource

forall 'k, C, R where Access[C -> 'k, R].
fn set_slot(&cx: C, slots: Slice[usize, 'k], i: usize, value: usize) { ... }

Sets slot i of slots to value under cx; stops the program past the end. Used by ArenaMap; not meant for direct use.

fn zero_slotssource

forall 'k, C, R where Access[C -> 'k, R].
fn zero_slots(&cx: C, slots: Slice[usize, 'k]) { ... }

Every slot emptied.

fn placesource

forall 'k, C, R where Access[C -> 'k, R].
fn place(&cx: C, slots: Slice[usize, 'k], hash: u32, entry: usize) { ... }

Puts entry in the first empty slot from where hash starts probing.

fn slice_of_zerossource

forall 'k, C, R where Allocate[C -> 'k, R].
fn slice_of_zeros(&cx: C, count: usize) -> Slice[usize, 'k] { ... }

count zeros in one block of the arena.