pub struct SnapshotCache { /* private fields */ }Expand description
LRU cache for snapshot storage
Implementations§
Source§impl SnapshotCache
impl SnapshotCache
Sourcepub fn get(&mut self, frame: u64) -> Option<&GameStateSnapshot>
pub fn get(&mut self, frame: u64) -> Option<&GameStateSnapshot>
Get snapshot from cache
Sourcepub fn insert(&mut self, frame: u64, snapshot: GameStateSnapshot)
pub fn insert(&mut self, frame: u64, snapshot: GameStateSnapshot)
Insert snapshot into cache
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SnapshotCache
impl RefUnwindSafe for SnapshotCache
impl Send for SnapshotCache
impl Sync for SnapshotCache
impl Unpin for SnapshotCache
impl UnsafeUnpin for SnapshotCache
impl UnwindSafe for SnapshotCache
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