pub struct GameStateSnapshot {
pub frame: u64,
pub state: GameStateData,
pub visual_phash: u64,
pub state_hash: u64,
}Expand description
Game state snapshot with delta encoding
Per spec: Delta encoding achieves 94% overhead reduction (Lavoie [9])
Fields§
§frame: u64Frame number when snapshot was taken
state: GameStateDataGame state data
visual_phash: u64Perceptual hash for visual comparison (more robust than SHA-256)
state_hash: u64Cryptographic hash for determinism verification
Implementations§
Source§impl GameStateSnapshot
impl GameStateSnapshot
Sourcepub fn new(frame: u64, state: GameStateData) -> Self
pub fn new(frame: u64, state: GameStateData) -> Self
Create a new snapshot
Sourcepub const fn with_phash(self, phash: u64) -> Self
pub const fn with_phash(self, phash: u64) -> Self
Set the perceptual hash
Trait Implementations§
Source§impl Clone for GameStateSnapshot
impl Clone for GameStateSnapshot
Source§fn clone(&self) -> GameStateSnapshot
fn clone(&self) -> GameStateSnapshot
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 GameStateSnapshot
impl Debug for GameStateSnapshot
Source§impl<'de> Deserialize<'de> for GameStateSnapshot
impl<'de> Deserialize<'de> for GameStateSnapshot
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 GameStateSnapshot
impl RefUnwindSafe for GameStateSnapshot
impl Send for GameStateSnapshot
impl Sync for GameStateSnapshot
impl Unpin for GameStateSnapshot
impl UnsafeUnpin for GameStateSnapshot
impl UnwindSafe for GameStateSnapshot
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