pub struct FrameRecord {
pub frame: u64,
pub inputs: Vec<InputEvent>,
pub state_hash: Option<[u8; 32]>,
}Expand description
Lean frame record - frame_number is the only clock needed.
Per Jain (2014): “Logical time is sufficient for reproducing bugs.”
Fields§
§frame: u64Frame number (monotonic, IS the logical clock for deterministic games).
inputs: Vec<InputEvent>Input events this frame (relative timing within frame if needed).
state_hash: Option<[u8; 32]>State hash for verification (optional in release traces).
Implementations§
Source§impl FrameRecord
impl FrameRecord
Sourcepub fn add_input(&mut self, event: InputEvent)
pub fn add_input(&mut self, event: InputEvent)
Add an input event to this frame.
Sourcepub const fn set_state_hash(&mut self, hash: [u8; 32])
pub const fn set_state_hash(&mut self, hash: [u8; 32])
Set the state hash for verification.
Sourcepub fn has_inputs(&self) -> bool
pub fn has_inputs(&self) -> bool
Check if this frame has any inputs.
Trait Implementations§
Source§impl Clone for FrameRecord
impl Clone for FrameRecord
Source§fn clone(&self) -> FrameRecord
fn clone(&self) -> FrameRecord
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FrameRecord
impl Debug for FrameRecord
Source§impl Default for FrameRecord
impl Default for FrameRecord
Source§fn default() -> FrameRecord
fn default() -> FrameRecord
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for FrameRecord
impl<'de> Deserialize<'de> for FrameRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FrameRecord
impl RefUnwindSafe for FrameRecord
impl Send for FrameRecord
impl Sync for FrameRecord
impl Unpin for FrameRecord
impl UnwindSafe for FrameRecord
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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