pub struct GameHostState {
pub input_queue: VecDeque<InputEvent>,
pub simulated_time: f64,
pub frame_count: u64,
pub snapshot_deltas: Vec<StateDelta>,
/* private fields */
}Expand description
Host state accessible to WASM guest
This struct holds the state that the WASM module can interact with through host function imports.
Fields§
§input_queue: VecDeque<InputEvent>Input queue for injection
simulated_time: f64Simulated game time
frame_count: u64Current frame count
snapshot_deltas: Vec<StateDelta>Snapshot deltas for replay
Implementations§
Source§impl GameHostState
impl GameHostState
Sourcepub fn pop_input(&mut self) -> Option<InputEvent>
pub fn pop_input(&mut self) -> Option<InputEvent>
Pop next input from queue
Sourcepub fn record_snapshot(&mut self, memory: &[u8])
pub fn record_snapshot(&mut self, memory: &[u8])
Record a state snapshot (delta-encoded)
Trait Implementations§
Source§impl Debug for GameHostState
impl Debug for GameHostState
Source§impl Default for GameHostState
impl Default for GameHostState
Source§fn default() -> GameHostState
fn default() -> GameHostState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GameHostState
impl RefUnwindSafe for GameHostState
impl Send for GameHostState
impl Sync for GameHostState
impl Unpin for GameHostState
impl UnsafeUnpin for GameHostState
impl UnwindSafe for GameHostState
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().