Skip to main content

NbaLog

Struct NbaLog 

Source
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

Source

pub fn new() -> Self

Source

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).

Source

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).

Source

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.

Source

pub fn stage_obj(&mut self, w: ObjWrite, source: ProcessId)

Appends a staged nonblocking write of class-property bits.

Source

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.

Source

pub fn is_empty(&self) -> bool

Source

pub fn len(&self) -> usize

Source

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.

Source

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).

Source

pub fn take_masked(&mut self) -> Vec<MaskedNbaUpdate>

Drains every staged partial / memory-row write.

Trait Implementations§

Source§

impl Debug for NbaLog

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for NbaLog

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