Skip to main content

RegionQueues

Struct RegionQueues 

Source
pub struct RegionQueues { /* private fields */ }
Expand description

The four region queues (SC-017..SC-022). active/inactive are VecDeque (FIFO-drained, and re-populated during draining by whatever processes the drained batch — that re-population is what makes the outer fixpoint loop possible); reactive/postponed are plain Vecs since they are drained exactly once per timestep and never need FIFO semantics mid-drain (SC-018, SC-019).

Implementations§

Source§

impl RegionQueues

Source

pub fn new() -> Self

Source

pub fn push( &mut self, region: Region, act: PendingActivation, ) -> Result<(), RegionQueuePushError>

Routes act to its region’s queue. Exhaustive match region over all 7 Region variants, no wildcard arm: Active/Inactive/ Reactive/Postponed route to their own queue and return Ok(()); Nba/Preponed/Observed return their own named Err(RegionQueuePushError) variant rather than a debug_assert! (which compiles to nothing — and so silently drops the activation with no queue, no panic, no error — in a release build). push must return Result so misuse is loud in every build profile and every caller (Tasks 11, 13, 15, 21) must handle/propagate it.

Source

pub fn drain_active(&mut self) -> Vec<PendingActivation>

Pops everything currently queued in Active, preserving FIFO order. Pushes made during draining (by whatever calls this) land in the queue for the next drain_active call, not this one — this is what makes the outer fixpoint loop possible.

Source

pub fn drain_inactive(&mut self) -> Vec<PendingActivation>

Pops everything currently queued in Inactive, preserving FIFO order. Same “not this call’s own later pushes” semantics as Self::drain_active.

Source

pub fn active_and_inactive_both_empty(&self) -> bool

true only once both Active and Inactive are empty at the moment of the call — callers must re-check after each drain round, since a drain’s own processing may re-populate either queue (SC-017, SC-022’s joint fixpoint).

Source

pub fn reactive_is_empty(&self) -> bool

true when nothing is queued in Reactive at the moment of the call (LRM 4.5: the Reactive region runs until it is empty, and a process it wakes in Reactive – a checker’s – joins it).

Source

pub fn drain_reactive_once(&mut self) -> Vec<PendingActivation>

Pops everything currently queued in Reactive. Intended to be called exactly once per timestep by the outer driver (Task 21 wires the “exactly once” part; this module only provides the primitive and proves it drains everything present, including zero items, without erroring). Returns [], never panics, when Reactive is empty (SC-018, SC-019 — “usually-empty… drained exactly once per timestep even when empty” must not need special-casing at call sites).

Source

pub fn push_re_inactive(&mut self, act: PendingActivation)

Queues act in the Re-Inactive region (LRM 4.4.2.7).

Source

pub fn drain_re_inactive(&mut self) -> Vec<PendingActivation>

Pops everything currently queued in Re-Inactive, FIFO.

Source

pub fn re_inactive_is_empty(&self) -> bool

true when nothing is queued in Re-Inactive.

Source

pub fn drain_postponed_once(&mut self) -> Vec<PendingActivation>

Pops everything currently queued in Postponed. Same “exactly once, even when empty, never errors” semantics as Self::drain_reactive_once.

Trait Implementations§

Source§

impl Default for RegionQueues

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V