pub trait SimulationState {
type AccessData: ?Sized;
type Event: Copy + Ord;
type EventContainer<'a>: Iterator<Item = Self::Event>
where Self: 'a;
// Required methods
fn data(&self) -> &Self::AccessData;
fn callables(&self) -> Self::EventContainer<'_>;
fn revertables(&self) -> Self::EventContainer<'_>;
fn callable(&self, event: Self::Event) -> bool;
fn revertable(&self, event: Self::Event) -> bool;
}Expand description
The SimulationState trait provides a read-only interface for inspecting the current state of a simulation.
Required Associated Types§
Sourcetype AccessData: ?Sized
type AccessData: ?Sized
The type used to access the current state data.
Sourcetype EventContainer<'a>: Iterator<Item = Self::Event>
where
Self: 'a
type EventContainer<'a>: Iterator<Item = Self::Event> where Self: 'a
The type of container used to access the available events.
Required Methods§
Sourcefn data(&self) -> &Self::AccessData
fn data(&self) -> &Self::AccessData
Returns a reference to the data which represents the current state.
Sourcefn callables(&self) -> Self::EventContainer<'_>
fn callables(&self) -> Self::EventContainer<'_>
Returns the events that can be called in the current state.
Sourcefn revertables(&self) -> Self::EventContainer<'_>
fn revertables(&self) -> Self::EventContainer<'_>
Returns the events that can be reverted in the current state.
Sourcefn callable(&self, event: Self::Event) -> bool
fn callable(&self, event: Self::Event) -> bool
Checks if the provided event can be called in the current state.
Sourcefn revertable(&self, event: Self::Event) -> bool
fn revertable(&self, event: Self::Event) -> bool
Checks if the provided event can be reverted in the current state.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.