Skip to main content

Crate kael_collections

Crate kael_collections 

Source
Expand description

§kael_collections

Fast, deterministic collection aliases used throughout Kael. The crate provides Fx-hashed versions of HashMap, HashSet, IndexMap, and IndexSet, alongside the standard collection re-exports expected by framework internals.

Use these aliases for trusted, in-process keys where predictable hashing and low overhead matter. Use the standard library’s randomized HashMap and HashSet for attacker-controlled keys that require hash-flood resistance.

use kael_collections::{HashMap, IndexMap};

let mut lookup = HashMap::default();
lookup.insert("workspace", 1);

let mut ordered = IndexMap::default();
ordered.insert("first", 1);
ordered.insert("second", 2);

assert_eq!(lookup["workspace"], 1);
assert_eq!(ordered.keys().copied().collect::<Vec<_>>(), ["first", "second"]);

See the API documentation for the complete set of aliases and re-exports, and the Kael guide for framework-level usage.

§License

Licensed under the Apache License, Version 2.0.

Modules§

binary_heap
A priority queue implemented with a binary heap.
btree_map
An ordered map based on a B-Tree.
btree_set
An ordered set based on a B-Tree.
hash_map
A hash map implemented with quadratic probing and SIMD lookup.
hash_set
A hash set implemented as a HashMap where the value is ().
linked_list
A doubly-linked list with owned nodes.
vec_deque
A double-ended queue (deque) implemented with a growable ring buffer.

Structs§

BTreeMap
An ordered map based on a B-Tree.
BTreeSet
An ordered set based on a B-Tree.
BinaryHeap
A priority queue implemented with a binary heap.
FxHasher
A speedy hash algorithm for use within rustc. The hashmap in liballoc by default uses SipHash which isn’t quite as speedy as we want. In the compiler we’re not really worried about DOS attempts, so we use a fast non-cryptographic hash.
LinkedList
A doubly-linked list with owned nodes.
TryReserveError
The error type for try_reserve methods.
VecDeque
A double-ended queue implemented with a growable ring buffer.

Enums§

Bound
An endpoint of a range of keys.
TryReserveErrorKindExperimental
Details of the allocation that caused a TryReserveError

Traits§

Equivalent
Key equivalence trait.

Type Aliases§

FxHashMap
Type alias for a hash map that uses the Fx hashing algorithm.
FxHashSet
Type alias for a hash set that uses the Fx hashing algorithm.
HashMap
A hash map using the fast, deterministic Fx hasher.
HashSet
A hash set using the fast, deterministic Fx hasher.
IndexMap
An insertion-ordered map using the fast, deterministic Fx hasher.
IndexSet
An insertion-ordered set using the fast, deterministic Fx hasher.