pub struct NbaLog { /* private fields */ }Expand description
The flat per-timestep NBA staging log (SC-034/SC-035/SC-036/SC-037).
Structurally cannot apply a write: stage’s signature takes no &mut dyn SignalAccess (or any other write-capable handle), so there is no call
this type could make even if its body were wrong — the only way an
NbaUpdate ever reaches signal storage is via NbaLog::take plus code
outside this module (Task 7’s commit_nba) that actually writes it
(SC-036).
Implementations§
Source§impl NbaLog
impl NbaLog
pub fn new() -> Self
Sourcepub fn stage(
&mut self,
cell: StateCellId,
value: FourStateValue,
source: ProcessId,
)
pub fn stage( &mut self, cell: StateCellId, value: FourStateValue, source: ProcessId, )
Appends a staged whole-cell write, ordered after every write staged before it (SC-034 — staging only, this call never applies anything).
Sourcepub fn stage_masked(
&mut self,
cell: StateCellId,
row: Option<u64>,
value: FourStateValue,
mask: Vec<u64>,
window: Option<u32>,
source: ProcessId,
)
pub fn stage_masked( &mut self, cell: StateCellId, row: Option<u64>, value: FourStateValue, mask: Vec<u64>, window: Option<u32>, source: ProcessId, )
Appends a staged partial / memory-row write (see MaskedNbaUpdate).
Sourcepub fn stage_coll(
&mut self,
cell: StateCellId,
row: Option<u64>,
elem: Vec<u64>,
coll: CollWrite,
source: ProcessId,
)
pub fn stage_coll( &mut self, cell: StateCellId, row: Option<u64>, elem: Vec<u64>, coll: CollWrite, source: ProcessId, )
Appends a staged nonblocking write of element coll.index (elem:
its words) of the collection whose handle cell (row row) holds.
Sourcepub fn stage_obj(&mut self, w: ObjWrite, source: ProcessId)
pub fn stage_obj(&mut self, w: ObjWrite, source: ProcessId)
Appends a staged nonblocking write of class-property bits.
Sourcepub fn stage_pulse(
&mut self,
cell: StateCellId,
row: Option<u64>,
source: ProcessId,
)
pub fn stage_pulse( &mut self, cell: StateCellId, row: Option<u64>, source: ProcessId, )
Appends a staged nonblocking event trigger (->> e) of event cell
(or of row row of an event array’s memory cell), ordered with every
other staged write.
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Empties the log (SC-037: called by the outer driver on now advance).
Idempotent — clearing an already-empty log is a no-op, never a panic.
Sourcepub fn take(&mut self) -> Vec<NbaUpdate>
pub fn take(&mut self) -> Vec<NbaUpdate>
Drains and returns every staged whole-cell entry (what Task 7’s
commit pass consumes). A genuine drain, not a clone: a second take()
with no intervening stage() returns [], so the same entries can
never be committed twice. Resets the order counter only once the
partial writes are drained too (take_masked).
Sourcepub fn take_masked(&mut self) -> Vec<MaskedNbaUpdate>
pub fn take_masked(&mut self) -> Vec<MaskedNbaUpdate>
Drains every staged partial / memory-row write.