many_cpus/
primitive_types.rs

1/// A processor identifier, used to differentiate processors in the system. This will match
2/// the numeric identifier used by standard tooling of the operating system.
3///
4/// It is important to highlight that the values used are not guaranteed to be sequential/contiguous
5/// or to start from zero (aspects that are also not guaranteed by operating system tooling).
6pub type ProcessorId = u32;
7
8/// A memory region identifier, used to differentiate memory regions in the system. This will match
9/// the numeric identifier used by standard tooling of the operating system.
10///
11/// It is important to highlight that the values used are not guaranteed to be sequential/contiguous
12/// or to start from zero (aspects that are also not guaranteed by operating system tooling).
13pub type MemoryRegionId = u32;
14
15/// Differentiates processors by their efficiency class, allowing work requiring high
16/// performance to be placed on the most performant processors at the expense of energy usage.
17///
18/// This is a relative measurement - the most performant processors in a system are always
19/// considered performance processors, with less performant ones considered efficiency processors.
20#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
21#[expect(
22    clippy::exhaustive_enums,
23    reason = "mirroring two-tier structure of platform APIs"
24)]
25pub enum EfficiencyClass {
26    /// A processor that is optimized for energy efficiency at the expense of performance.
27    Efficiency,
28
29    /// A processor that is optimized for performance at the expense of energy efficiency.
30    Performance,
31}