Crate pia[][src]

Expand description

PIA (Packed Integer Array)

PIA is a simple library for the Rust programming language that adds packed integer arrays for mass storage of oddly sized variables.

To get started simply construct a new instance of a PackedIntegerArray with the desired amount of items and bits per item.

// Constructs a new packed integer array with 5 bits per item and 4 items
let packed_array = pia::PackedIntegerArray::<5, 4>::new();

After that, use the array just like any other array. Items can be set using PackedIntegerArray::set(), items can be queried using PackedIntegerArray::get(), and items can be reset back to 0 using PackedIntegerArray::clear().

Structs

A wrapped array that bit packs LEN amount of items each of BITS amount of bits into an array of u8s.

A simple iterator that moves over every unpacked value in a PackedIntegerArray.

Functions

A helper function to determine the minimum amount of u8s that are needed in order to house size amount of items each of bits amount of bits.