Expand description
§PaletteVec
PaletteVec is a space-efficient data structure for storing collections
with a limited set of repeated elements. It uses a palette-based encoding
scheme, similar to how indexed color images or Minecraft chunk data are stored.
This approach can lead to significant memory savings when dealing with repetitive data, while still allowing for direct manipulation of the collection.
§Core Components
PaletteVec<T, P, B>: The main data structure.T: The type of elements stored. Must beEq + Hash + Clone.P: ThePaletteimplementation (e.g.,HybridPalette).B: TheIndexBufferimplementation (e.g.,AlignedIndexBuffer).
Palette<T>trait: Defines the interface for palette implementations.IndexBuffertrait: Defines the interface for how indices are stored.
Modules§
- index_
buffer - Index buffers dictate how the actual indices are stored in memory and how they are accessed.
- palette
- The Palette dictates how the actual values you insert into a PaletteVec are stored and accessed.
Structs§
- Memory
Usage - Palette
Vec - A vector-like data structure that uses a palette to store unique elements, significantly reducing memory for collections with many repeated values.
- Palette
VecIter