Module id_set

Source
Expand description

A fixed-size set of unique IDs.

This module introduces two abstract data collection types. The first one is IdSet<I>, a set that contains at most I::cardinality() items, each of which represents a unique ID of type I. The second one is AtomicIdSet<I>, the atomic version of IdSet<I>.

The type parameter I implements the Id trait, which abstracts any ID type whose instances can be 1:1 mapped to the integers from 0 to Id::cardinality() (exclusive). The ID type is required to implement Into<u32> and TryFrom<u32>.

One use case of IdSet<I> inside OSTD is to implement a set of CPU IDs. crate::cpu::CpuSet has been simply defined as a typa alias for IdSet<CpuId>.

Structs§

AtomicIdSet
A set of IDs that may be accessed concurrently.
IdSet
A set of IDs.

Traits§

Id
A trait to abstract an ID type.
IdSetSlicer
A trait that unifies all types that slice a portion of IdSet.