pub struct OutputDeck { /* private fields */ }Expand description
Mutable typed deck collecting lane outputs for one tick.
Each typed slot is created on first access, holding T::default() until
a lane writes into it. The engine drains specific types at the I/O
boundary (submit, present) via OutputDeck::take.
Implementations§
Source§impl OutputDeck
impl OutputDeck
Sourcepub fn slot<T: Default + Any + Send + Sync>(&mut self) -> &mut T
pub fn slot<T: Default + Any + Send + Sync>(&mut self) -> &mut T
Returns a mutable reference to the slot for type T, creating it
with T::default() on first access.
Lanes call this to accumulate outputs (e.g. push command buffers
onto a Vec).
Sourcepub fn take<T: Default + Any + Send + Sync>(&mut self) -> T
pub fn take<T: Default + Any + Send + Sync>(&mut self) -> T
Removes and returns the slot for type T, replacing it with the
default value (so subsequent ticks start clean).
Returns T::default() if no lane wrote into this slot during the
tick. Used by the engine at the I/O boundary.
Sourcepub fn contains<T: Any + Send + Sync>(&self) -> bool
pub fn contains<T: Any + Send + Sync>(&self) -> bool
Reports whether a slot of the given type has been written this tick.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears all slots. Called by the scheduler between ticks if a deck instance is reused rather than reallocated.
Sourcepub fn merge_from(&mut self, other: OutputDeck)
pub fn merge_from(&mut self, other: OutputDeck)
Moves every slot from other into self.
Used by the parallel executor to fold a worker’s private deck shard back
into the shared deck after a concurrent wave. The merged shards are
expected to write disjoint slot types (guaranteed by the executor’s
AgentAccess::Isolated eligibility
rules). A colliding TypeId is therefore a scheduling bug: the existing
slot is kept and the collision logged, rather than silently dropping one
side’s outputs.