Type Alias mozjs_sys::jsapi::JS::AutoRooterListHeads

source ·
pub type AutoRooterListHeads = __BindgenOpaqueArray<u64, 3usize>;
Expand description

EnumeratedArray is a fixed-size array container for use when an array is indexed by a specific enum class.

This provides type safety by guarding at compile time against accidentally indexing such arrays with unrelated values. This also removes the need for manual casting when using a typed enum value to index arrays.

Aside from the typing of indices, EnumeratedArray is similar to Array.

Example:

enum class AnimalSpecies { Cow, Sheep, Count };

EnumeratedArray<AnimalSpecies, int, AnimalSpecies::Count> headCount;

headCount[AnimalSpecies::Cow] = 17; headCount[AnimalSpecies::Sheep] = 30;

If the enum class has contiguous values and provides a specialization of mozilla::MaxContiguousEnumValue then the size will be calculated as the max value + 1.

Aliased Type§

struct AutoRooterListHeads(pub [u64; 3]);

Fields§

§0: [u64; 3]