Expand description
This crate makes it possible to store objects containing dynamic fields either compactly in consecutive memory or using traditional heap pointers.
Bread-and-butter datastructures are offered, they feature:
- transparent access semantics, independent of currently used storage
- automatic spill from exhausted compact storage to heap storage
- recursive re-compaction
This is used in Kay for:
- Storing actor state compactly in one place for cache coherency and easy persistence
- Sending complex, dynamically-sized messages over boundaries such as actors, threads and the network
Structs§
- CDict
- A simple linear-search key-value dictionary,
implemented using two
CompactVec’s, one for keys, one for values. - CHash
Map - A dynamically-sized open adressing quadratic probing hashmap
that can be stored in compact sequential storage and
automatically spills over into free heap storage using
Allocator. - COption
- A wrapper to make an
Optionof a nontrivialCompactpossible. Unfortunately, we can’t blanket-implthat, since that overlaps (for the compiler) with theimplfor trivialCopytypes… - CString
- A compact storage for a
String. So far doesn’t support direct mutable operations, Only conversion from and toString/&str - CVec
- A dynamically-sized vector that can be stored in compact sequential storage and
automatically spills over into free heap storage using
Allocator. Tries to closely follow the API ofstd::vec::Vec, but is not complete.
Traits§
- Compact
- A trait for objects with a statically-sized part and a potential dynamically-sized part that can be stored both compactly in consecutive memory or freely on the heap