pub struct Simulation<A = StreamAuthorityStore<MemoryStream>, O = ProviderObjectStore<MemoryObjects>> { /* private fields */ }Expand description
Shared deterministic simulator and its two backend handles.
Implementations§
Source§impl Simulation<StreamAuthorityStore<MemoryStream>, ProviderObjectStore<MemoryObjects>>
impl Simulation<StreamAuthorityStore<MemoryStream>, ProviderObjectStore<MemoryObjects>>
Sourcepub fn new(options: SimulationOptions) -> Result<Self, SimulationError>
pub fn new(options: SimulationOptions) -> Result<Self, SimulationError>
Creates a bounded simulator over fresh deterministic memory primitives.
§Errors
Rejects any zero hard bound before allocating simulator state.
Source§impl<A, O> Simulation<A, O>
impl<A, O> Simulation<A, O>
Sourcepub fn wrap(
authority: A,
objects: O,
options: SimulationOptions,
) -> Result<Self, SimulationError>
pub fn wrap( authority: A, objects: O, options: SimulationOptions, ) -> Result<Self, SimulationError>
Wraps explicit backends with one bounded deterministic schedule.
This is the black-box qualification seam for future infrastructure adapters. The simulator does not inspect or replace backend state.
§Errors
Rejects any zero hard bound before retaining the supplied backends.
Sourcepub fn stores(&self) -> (SimulatedAuthorityStore<A>, SimulatedObjectStore<O>)
pub fn stores(&self) -> (SimulatedAuthorityStore<A>, SimulatedObjectStore<O>)
Returns independently cloneable authority and object handles sharing one schedule.
Sourcepub fn schedule(
&self,
scheduled: ScheduledSimulationFault,
) -> Result<(), SimulationError>
pub fn schedule( &self, scheduled: ScheduledSimulationFault, ) -> Result<(), SimulationError>
Schedules one exact one-based interception point.
§Errors
Rejects zero occurrences, incompatible behavior, duplicate identities, poisoned state, or a full bounded schedule.
Sourcepub fn schedule_next(
&self,
operation: SimulationOperation,
fault: SimulationFault,
) -> Result<ScheduledSimulationFault, SimulationError>
pub fn schedule_next( &self, operation: SimulationOperation, fault: SimulationFault, ) -> Result<ScheduledSimulationFault, SimulationError>
Atomically schedules the next occurrence of one operation family.
This is useful for deterministic black-box runners after setup traffic. Concurrent runners should retain the returned absolute occurrence in their evidence rather than assume which request consumes it.
§Errors
Rejects incompatible behavior, occurrence exhaustion, poisoned state, or a full bounded schedule.
Sourcepub fn trace(&self) -> Result<Vec<SimulationTrace>, SimulationError>
pub fn trace(&self) -> Result<Vec<SimulationTrace>, SimulationError>
Returns the complete bounded trace collected so far.
§Errors
Returns a poisoned-state failure instead of silently discarding evidence.
Source§impl<A, O: AsyncObjectStore> Simulation<A, O>
impl<A, O: AsyncObjectStore> Simulation<A, O>
Sourcepub async fn flush_object_visibility(
&self,
budget: WorkBudget,
cancellation: &CancellationToken,
) -> ObjectResult<u64>
pub async fn flush_object_visibility( &self, budget: WorkBudget, cancellation: &CancellationToken, ) -> ObjectResult<u64>
Publishes delayed immutable objects in canonical identity order.
Only one pending entry is retained outside the simulator lock at a time,
so flushing does not allocate or copy the delayed object set. Bytes
cloning retains the same immutable allocation until backend admission.
§Errors
Returns exact immutable-store, cancellation, budget, or poisoned-state failures. Successfully published entries are removed; the first failed entry and every later entry remain pending for an idempotent retry.
Trait Implementations§
Auto Trait Implementations§
impl<A, O> Freeze for Simulation<A, O>
impl<A, O> RefUnwindSafe for Simulation<A, O>
impl<A, O> Send for Simulation<A, O>
impl<A, O> Sync for Simulation<A, O>
impl<A, O> Unpin for Simulation<A, O>
impl<A, O> UnsafeUnpin for Simulation<A, O>
impl<A, O> UnwindSafe for Simulation<A, O>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request