AutoArrayHashMapUnmanaged
An ArrayHashMapUnmanaged with default hash and equal functions.
See AutoContext for a description of the hash and equal implementations.
Fields of this type
Fields
Modifying the key is allowed only if it does not change the hash.
Types
- Entry
- Modifying the key is allowed only if it does not change the hash.
- KV
- A KV pair which has been copied out of the backing store
- Data
- The Data type used for the MultiArrayList backing this map
- GetOrPutResult
- getOrPut variants return this structure, with pointers
Convert from an unmanaged map to a managed map.
Functions
- promote
- Convert from an unmanaged map to a managed map.
- reinit
- An empty `value_list` may be passed, in which case the values array becomes `undefined`.
- deinit
- Frees the backing allocation and leaves the map in an undefined state.
- lockPointers
- Puts the hash map into a state where any method call that would
- unlockPointers
- Undoes a call to `lockPointers`.
- clearRetainingCapacity
- Clears the map but retains the backing allocation for future use.
- clearAndFree
- Clears the map and releases the backing allocation
- count
- Returns the number of KV pairs stored in this map.
- keys
- Returns the backing array of keys in this map.
- values
- Returns the backing array of values in this map.
- iterator
- Returns an iterator over the pairs in this map.
- getOrPut
- If key exists this function cannot fail.
- getOrPutAssumeCapacity
- If there is an existing item with `key`, then the result
- getOrPutAssumeCapacityAdapted
- If there is an existing item with `key`, then the result
- ensureTotalCapacity
- Increases capacity, guaranteeing that insertions up until the
- ensureUnusedCapacity
- Increases capacity, guaranteeing that insertions up until
- capacity
- Returns the number of total elements which may be present before it is
- put
- Clobbers any existing data.
- putNoClobber
- Inserts a key-value pair into the hash map, asserting that no previous
- putAssumeCapacity
- Asserts there is enough capacity to store the new key-value pair.
- putAssumeCapacityNoClobber
- Asserts there is enough capacity to store the new key-value pair.
- fetchPut
- Inserts a new `Entry` into the hash map, returning the previous one, if any.
- fetchPutAssumeCapacity
- Inserts a new `Entry` into the hash map, returning the previous one, if any.
- getEntry
- Finds pointers to the key and value storage associated with a key.
- getIndex
- Finds the index in the `entries` array where a key is stored
- get
- Find the value associated with a key
- getPtr
- Find a pointer to the value associated with a key
- getKey
- Find the actual key associated with an adapted key
- getKeyPtr
- Find a pointer to the actual key associated with an adapted key
- contains
- Check whether a key is stored in the map
- fetchSwapRemove
- If there is an `Entry` with a matching key, it is deleted from
- fetchOrderedRemove
- If there is an `Entry` with a matching key, it is deleted from
- swapRemove
- If there is an `Entry` with a matching key, it is deleted from
- orderedRemove
- If there is an `Entry` with a matching key, it is deleted from
- swapRemoveAt
- Deletes the item at the specified index in `entries` from
- orderedRemoveAt
- Deletes the item at the specified index in `entries` from
- orderedRemoveAtMany
- Remove the entries indexed by `sorted_indexes`.
- clone
- Create a copy of the hash map which can be modified separately.
- move
- Set the map to an empty state, making deinitialization a no-op, and
- reIndex
- Recomputes stored hashes and rebuilds the key indexes.
- setKey
- Modify an entry's key without reordering any entries.
- sort
- Sorts the entries and then rebuilds the index.
- sortUnstable
- Sorts the entries and then rebuilds the index.
- shrinkRetainingCapacity
- Shrinks the underlying `Entry` array to `new_len` elements and
- shrinkRetainingCapacityContext
- Shrinks the underlying `Entry` array to `new_len` elements and
- shrinkAndFree
- Shrinks the underlying `Entry` array to `new_len` elements and
- shrinkAndFreeContext
- Shrinks the underlying `Entry` array to `new_len` elements and
- pop
- Removes the last inserted `Entry` in the hash map and returns it.
A map containing no keys or values.
Values
- empty
- A map containing no keys or values.
Source
Implementation
pub fn AutoArrayHashMapUnmanaged(comptime K: type, comptime V: type) type {
return ArrayHashMapUnmanaged(K, V, AutoContext(K), !autoEqlIsCheap(K));
}