Type Alias SimulationBorrowMut

Source
pub type SimulationBorrowMut<'a, Info> = GenericSimulationBorrow<'a, Info, &'a mut <Info as SimulationInfo>::State>;
Expand description

Represents a single mutable simulation.

Aliased Type§

struct SimulationBorrowMut<'a, Info> {
    pub state: &'a mut <Info as SimulationInfo>::State,
    /* private fields */
}

Fields§

§state: &'a mut <Info as SimulationInfo>::State

The referenced simulation state.

Trait Implementations§

Source§

impl<Info: SimulationInfo> Simulation for SimulationBorrowMut<'_, Info>

Source§

type StateLoadingError = <Info as SimulationInfo>::StateLoadingError

The error type returned when loading the simulation state fails.
Source§

type AccessData = <Info as SimulationInfo>::AccessData

The type used to access the current state.
Source§

type LoadData = <Info as SimulationInfo>::LoadData

The type of data used to load the simulation state.
Source§

type Event = <Info as SimulationInfo>::Event

The type of events that can be called or reverted in the simulation.
Source§

type EventContainer<'a> = <Info as SimulationInfo>::EventContainer<'a> where Self: 'a

The type of container used to access the available events.
Source§

fn data(&self) -> &Info::AccessData

Returns a reference to the data which repsesents the current state.
Source§

fn reload( &mut self, data: Info::LoadData, ) -> Result<(), Info::StateLoadingError>

Reloads the simulation state from the provided data.
Source§

fn callables(&self) -> Info::EventContainer<'_>

Returns the events that can currently be called.
Source§

fn callable(&self, event: Info::Event) -> bool

Checks if the provided event can be called.
Source§

unsafe fn call(&mut self, event: Info::Event)

Calls the provided event. Read more
Source§

fn revertables(&self) -> Info::EventContainer<'_>

Returns the events that can currently be reverted.
Source§

fn revertable(&self, event: Info::Event) -> bool

Checks if the provided event can be reverted.
Source§

unsafe fn revert(&mut self, event: Info::Event)

Reverts the provided event. Read more
Source§

fn try_call(&mut self, event: Self::Event) -> bool

Tries to call the provided event and returns if it was successful.
Source§

fn try_revert(&mut self, event: Self::Event) -> bool

Tries to revert the provided event and returns if it was successful.
Source§

fn prepare_call(&mut self) -> CallState<'_, Self, Call>

Prepares a safe helper to list callable elements and choose one to call.
Source§

fn prepare_revert(&mut self) -> CallState<'_, Self, Revert>

Prepares a safe helper to list revertable elements and choose one to revert.