rok::core::collections::dict
rok::core::collections::dict - Dict<K, V>, a hash map (stdlib spec
2.9.3), compact: entries are appended to dense key / value / hash
arrays, and a power-of-two index of linear-probed slots maps a hash to
its entry. A table of at most SMALL entries has no index: lookup
scans the hashes. remove leaves a hole; holes are squeezed out when
the entries are full. One object holds the counts and the current
arrays, swapped on growth. Iteration follows the entries, so it is in
insertion order (which OrderedDict relies on; for Dict the spec
leaves it unspecified).
Structs
DictHead
pub struct DictHead<KThe dict's object. keys / vals have one more slot that stays
zero: a hole's key and value are overwritten with it, so a removed
entry keeps nothing alive. meta holds cap entry hashes (0: a
hole), then slots index slots (0: empty, else entry + 1). An index
slot of a removed entry stays, pointing at the hole: a tombstone,
passed over because no lookup hash is 0. Index slots in use never
exceed cap, at most 2/3 of slots, so probing always ends.
Dict
pub struct Dict<KEntry
pub struct Entry<Kd.entry(k): read or fill one key's slot. Each call looks the key
up again.
KeysIter
pub struct KeysIter<KValuesIter
pub struct ValuesIter<KEntriesIter
pub struct EntriesIter<KFunctions
dict_literal
pub const fn dict_literal<K: Hash{k: v, ..} (refs-lang 6.5.1, 6.5.6).