Skip to main content

SimulatedExecutor

Struct SimulatedExecutor 

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

Simulation-mode Executor — Phase 0 uses real tokio::spawn while recording spawned-task counts for property checks.

The full single-threaded deterministic scheduler (per pulse-architecture-v1.md §10.5) lands in a later phase when cross-task interleaving needs to be controlled by the harness — that scheduler is crate::SimScheduler.

This executor runs tasks on the multi-threaded tokio runtime and only counts spawns; it does not by itself make a workload deterministic. Time and Random are reproducible only under single-threaded drive (see crate::SimScheduler); spawning shared clocks/RNGs across tokio worker threads through this executor gives a run-to-run-varying interleaving. For a replayable run, drive the workload on crate::SimScheduler.

Implementations§

Source§

impl SimulatedExecutor

Source

pub fn new() -> Self

Create an executor with a zeroed spawn counter.

Source

pub fn spawned_count(&self) -> u64

Total number of spawn calls observed.

Trait Implementations§

Source§

impl Default for SimulatedExecutor

Source§

fn default() -> Self

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

impl Executor for SimulatedExecutor

Source§

type JoinHandle<O: Send + 'static> = JoinHandle<O>

Handle to a spawned task (ADR-0066). Production/simulation use tokio’s JoinHandle; a deterministic SimScheduler-backed executor uses its own scheduler-native handle. The abstraction has NO required surface — every production spawn() call site discards the handle — so this GAT is pure prep that keeps the existing executors byte-identical while unblocking a non-tokio implementation.
Source§

fn spawn<F>(&self, future: F) -> Self::JoinHandle<F::Output>
where F: Future + Send + 'static, F::Output: Send + 'static,

Spawn a future on the executor; returns a handle bound to the future’s output.

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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