read_fonts::collections

Module int_set

Source
Available on crate feature std only.
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§

  • Provides serialization of IntSet’s to a highly compact bitset format as defined in the IFT specification:

Structs§

  • Marks a mapped value as being in the domain of T for Domain.
  • A fast & efficient invertible ordered set for small (up to 32-bit) unsigned integer types.

Traits§

  • Defines the domain of IntSet member types.