Skip to main content

Crate palettevec

Crate palettevec 

Source
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 be Eq + Hash + Clone.
    • P: The Palette implementation (e.g., HybridPalette).
    • B: The IndexBuffer implementation (e.g., AlignedIndexBuffer).
  • Palette<T> trait: Defines the interface for palette implementations.
  • IndexBuffer trait: 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§

MemoryUsage
PaletteVec
A vector-like data structure that uses a palette to store unique elements, significantly reducing memory for collections with many repeated values.
PaletteVecIter