Module int_set

Source
Expand description

A fast, efficient, sparse, & ordered unsigned integer (u32) bit set which is invertible.

The bitset is implemented using fixed size pages which allows it to compactly represent sparse membership. However, the set excels when set members are typically clustered together. For example when representing glyph id or unicode codepoint values in a font.

The set can have inclusive (the set of integers which are members) or exclusive (the set of integers which are not members) membership. The exclusive/inverted version of the set is useful for patterns such as β€œkeep all codepoints except for {x, y, z, …}”.

When constructing a new IntSet from an existing lists of integer values the most efficient way to create the set is to initialize it from a sorted (ascending) iterator of the values.

For a type to be stored in the IntSet it must implement the Domain trait, and all unique values of that type must be able to be mapped to and from a unique u32 value. See the Domain trait for more information.

ModulesΒ§

bitpage πŸ”’
Stores a page of bits, used inside of bitset’s.
bitset πŸ”’
A fast, efficient, sparse, & ordered unsigned integer (u32) bit set.
input_bit_stream πŸ”’
Reads individual bits from a array of bytes.
output_bit_stream πŸ”’
Writes individual bits to a vector of bytes.
sparse_bit_set
Provides serialization of IntSet’s to a highly compact bitset format as defined in the IFT specification:

StructsΒ§

InDomain
Marks a mapped value as being in the domain of T for Domain.
IntSet
A fast & efficient invertible ordered set for small (up to 32-bit) unsigned integer types.
Iter πŸ”’
U32Set
A fast, efficient, sparse, & ordered u32 set.

EnumsΒ§

Membership πŸ”’
RangeIter πŸ”’

TraitsΒ§

Domain
Defines the domain of IntSet member types.