pub struct SaveState<T> { /* private fields */ }
Expand description
A command for saving the state of the game.
Consumers MUST save before the command is dropped. Failure to do so will result in a panic.
Implementations
sourceimpl<T: Clone> SaveState<T>
impl<T: Clone> SaveState<T>
sourcepub fn save(self, state: T)where
T: Hash,
pub fn save(self, state: T)where
T: Hash,
Saves a single frame’s state to the session’s state buffer and uses the hash of the state as the checksum. This uses the DefaultHasher implementation.
This consumes the SaveState, saving multiple times is not allowed.
sourcepub fn save_without_hash(self, state: T)
pub fn save_without_hash(self, state: T)
Saves a single frame’s state to the session’s state buffer without a saved checksum.
This consumes the SaveState, saving multiple times is not allowed.
sourcepub fn save_with_hash(self, state: T, checksum: u64)
pub fn save_with_hash(self, state: T, checksum: u64)
Saves a single frame’s state to the session’s state buffer with a provided checksum.
This consumes the SaveState, saving multiple times is not allowed.
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for SaveState<T>
impl<T> Send for SaveState<T>where
T: Send,
impl<T> Sync for SaveState<T>where
T: Send,
impl<T> Unpin for SaveState<T>
impl<T> !UnwindSafe for SaveState<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more