pub enum ModelState {
Cpu(Box<dyn SimState>),
Gpu(Box<dyn GpuSimState>),
}Expand description
A freshly built simulation state, tagged with the runner that can drive it.
The two arms are not interchangeable. A CPU state steps one tick per call on a
SimThread, and a GPU state encodes many steps into one submission on a
GpuSimThread. A caller picks the runner from the arm without downcasting.
Variants§
Cpu(Box<dyn SimState>)
A CPU state, for a SimThread.
Gpu(Box<dyn GpuSimState>)
A GPU state, for a GpuSimThread.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ModelState
impl !Sync for ModelState
impl !UnwindSafe for ModelState
impl Freeze for ModelState
impl Send for ModelState
impl Unpin for ModelState
impl UnsafeUnpin for ModelState
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
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more