Skip to main content

Dispatch

Struct Dispatch 

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

The fixed 3-role VC listener dispatch table (ST-073, ST-074). See this module’s doc comment for why this is 3 named fields, not a collection.

Implementations§

Source§

impl Dispatch

Source

pub fn new() -> Self

Source

pub fn register( &mut self, role: ListenerRole, sink: Box<dyn ValueChangeSink + Send>, )

Registers sink for role, replacing any previously-registered sink for that same role (last write wins — this task does not introduce a multi-listener-per-role fan-out; each of the 3 roles holds at most one sink, matching Dispatch’s own field shape). The match is exhaustive with no wildcard arm: ListenerRole has exactly 3 variants (frozen in state::mod’s Task-0 contract stub), so this is the concrete enforcement ST-073’s “attempting a fourth/unknown role is a compile-time… invalid call” asks for — a 4th variant added to ListenerRole anywhere in this crate breaks this match at compile time (ARCHITECTURE §7 item 9’s exhaustive-match discipline).

Source

pub fn dispatch( &mut self, cell: StateCellId, edge: EdgeKind, at: SimTime, region: Region, )

Fans notify_change out to every registered sink, in the fixed Scheduler, Waveform, Vpi order (ST-073), via 3 unrolled if let Some(..) checks — never a loop over a collection, so this method’s cost is the same 3 branches regardless of how many times it has been called before (ST-074).

Source

pub fn notify_scheduler( &mut self, cell: StateCellId, edge: EdgeKind, at: SimTime, region: Region, )

Task 12 (ST-075): the only fan-out write::commit_write (state::write) ever calls — fires the Scheduler slot alone, unconditionally, on every real change, immediately (never GVT-gated: v1’s conservative LOOKAHEAD_CYCLES = 0 engine has no outstanding speculation, so “speculative” and “committed” coincide at every event). Never touches waveform/vpi — those observe exclusively through StateEngine::drain_committed_changes (state::gvt), never through this method.

Source

pub fn notify_waveform_and_vpi( &mut self, cell: StateCellId, edge: EdgeKind, at: SimTime, region: Region, )

Task 12 (ST-078): the Scheduler-less analogue of dispatch — fires waveform then vpi, in that fixed order, each only if registered, never scheduler. Not called eagerly from commit_write (see that method’s own doc comment): Waveform/VPI/$display-style consumers observe committed changes through StateEngine::drain_committed_changes’s returned VcRecords instead; this method exists for a future caller (e.g. RUNTIME) that already has EdgeKind/Region context to push an eager per-write callback on top of that commit-stream.

Trait Implementations§

Source§

impl Default for Dispatch

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