pub enum Priority {
Critical = 0,
Normal = 1,
BestEffort = 2,
}Expand description
Criticality bucket for SchedContext. Phase 110.C uses this to
pick which RankedFifoSet / BucketedEdfSet slot a callback
dispatches through; later phases (110.D) map it to OS priority.
Default Normal keeps existing single-bucket workloads unchanged
— every default-Fifo SC sits in Normal, so dispatch order is
bit-identical to pre-110.C when no callback opts in to Critical
or BestEffort.
Single-thread non-preemption note: a BestEffort callback already
running blocks Critical work that becomes ready mid-cycle. Hard-
RT scenarios need 110.D’s multi-executor preemption.
Variants§
Critical = 0
Highest-priority bucket. Drained first within a single
spin_once cycle; non-preemptive against in-flight lower-
priority callbacks (see Phase 110.D for preemption).
Normal = 1
Default bucket. Most callbacks (and the auto-default Fifo SC) live here.
BestEffort = 2
Lowest-priority bucket. Drained last; first to be skipped if a future cycle-budget overrun forces an early return.
Implementations§
Source§impl Priority
impl Priority
pub const COUNT: usize = 3
pub const fn index(self) -> usize
Sourcepub const fn dispatch_level(self, rank: u8) -> u8
pub const fn dispatch_level(self, rank: u8) -> u8
phase-509 P2 (RFC-0108 D2) – the dispatch level of a callback whose
sched context is in this bucket and whose node holds contract rank
(0 = most urgent). Smaller levels dispatch first; equal levels keep
registration order.
The three buckets are three RESERVED ranks around the contract’s: a
Critical callback is level 0 and a BestEffort one level
DISPATCH_LEVELS - 1 whatever their rank, and a Normal one (the
default) is 1 + rank, clamped to MAX_CONTRACT_RANK. So the C and
C++ Priority API orders exactly as before, and an image whose nodes
hold one rank dispatches in exactly today’s order.
Sourcepub const fn level_range(self) -> (u8, u8)
pub const fn level_range(self) -> (u8, u8)
The dispatch levels this bucket spans, lo..hi.
Sourcepub const fn from_index(index: usize) -> Self
pub const fn from_index(index: usize) -> Self
The bucket at index (Self::index’s inverse); Normal past the end.