pub struct CheckpointManager { /* private fields */ }Expand description
A bounded ring of guard-verified safe-prefix checkpoints. Fixed memory: the
oldest checkpoint is dropped once cap is reached (ADR-003). A cap of 0
(or disable) retains nothing — the loop then has no
rollback target and fails closed on a breach.
Implementations§
Source§impl CheckpointManager
impl CheckpointManager
pub fn new(cap: u8) -> CheckpointManager
pub fn enabled(&self) -> bool
Sourcepub fn disable(&mut self)
pub fn disable(&mut self)
Drop all checkpoints and stop retaining new ones (memory-pressure degradation — ADR-012/ADR-003).
Sourcepub fn push(&mut self, checkpoint: Checkpoint)
pub fn push(&mut self, checkpoint: Checkpoint)
Record a safe prefix; evicts the oldest if the ring is full. No-op when disabled.
Sourcepub fn last(&self) -> Option<Checkpoint>
pub fn last(&self) -> Option<Checkpoint>
The most recent safe prefix, if any.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Debug for CheckpointManager
impl Debug for CheckpointManager
Source§impl Default for CheckpointManager
impl Default for CheckpointManager
Source§fn default() -> CheckpointManager
fn default() -> CheckpointManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CheckpointManager
impl RefUnwindSafe for CheckpointManager
impl Send for CheckpointManager
impl Sync for CheckpointManager
impl Unpin for CheckpointManager
impl UnsafeUnpin for CheckpointManager
impl UnwindSafe for CheckpointManager
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