pub struct RollbackBuffer { /* private fields */ }Expand description
120-frame ring buffer for prediction/correction rollback.
Exactly 1.0 second at 120Hz. Architecturally locked — never grows.
Each frame stores a FrameSnapshot that references diffs in the DiffPool.
Implementations§
Source§impl RollbackBuffer
impl RollbackBuffer
Sourcepub fn push(&mut self, snapshot: FrameSnapshot)
pub fn push(&mut self, snapshot: FrameSnapshot)
Record a frame snapshot. Overwrites oldest if buffer is full.
Sourcepub fn find_by_tick(&self, tick: u64) -> Option<&FrameSnapshot>
pub fn find_by_tick(&self, tick: u64) -> Option<&FrameSnapshot>
Find a frame by tick number. Returns None if not in the buffer.
Sourcepub fn latest(&self) -> Option<&FrameSnapshot>
pub fn latest(&self) -> Option<&FrameSnapshot>
Get the most recent frame snapshot.
Sourcepub fn frames_forward(
&self,
start_tick: u64,
end_tick: u64,
) -> FrameRangeIter<'_> ⓘ
pub fn frames_forward( &self, start_tick: u64, end_tick: u64, ) -> FrameRangeIter<'_> ⓘ
Iterate frames from start_tick to end_tick (inclusive) in forward order.
Used for replay (old→new) after rewind.
Sourcepub fn frames_reverse(
&self,
start_tick: u64,
end_tick: u64,
) -> FrameRangeReverseIter<'_> ⓘ
pub fn frames_reverse( &self, start_tick: u64, end_tick: u64, ) -> FrameRangeReverseIter<'_> ⓘ
Iterate frames from end_tick back to start_tick (inclusive) in reverse order.
Used for rewind (new→old).
Auto Trait Implementations§
impl Freeze for RollbackBuffer
impl RefUnwindSafe for RollbackBuffer
impl Send for RollbackBuffer
impl Sync for RollbackBuffer
impl Unpin for RollbackBuffer
impl UnsafeUnpin for RollbackBuffer
impl UnwindSafe for RollbackBuffer
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