pub struct CheckpointState { /* private fields */ }Expand description
Shared session-scoped checkpoint state built on top of FileHistory.
This keeps the existing rollback primitive as the source of truth for file contents while adding lightweight checkpoint metadata that later layers can persist or surface in the UI.
Implementations§
Source§impl CheckpointState
impl CheckpointState
pub fn new() -> Self
Sourcepub fn snapshot_paths(
&self,
paths: &[PathBuf],
label: Option<String>,
) -> Result<Option<CheckpointRecord>>
pub fn snapshot_paths( &self, paths: &[PathBuf], label: Option<String>, ) -> Result<Option<CheckpointRecord>>
Snapshot a set of existing files and record a checkpoint if any were captured.
pub fn checkpoints(&self) -> Vec<CheckpointRecord>
pub fn checkpoint(&self, id: &str) -> Option<CheckpointRecord>
pub fn restore_checkpoint(&self, id: &str) -> Result<Vec<PathBuf>>
pub fn rollback(&self, path: &Path) -> Result<()>
pub fn tracked_files(&self) -> Vec<PathBuf>
pub fn original(&self, path: &Path) -> Option<String>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CheckpointState
impl RefUnwindSafe for CheckpointState
impl Send for CheckpointState
impl Sync for CheckpointState
impl Unpin for CheckpointState
impl UnsafeUnpin for CheckpointState
impl UnwindSafe for CheckpointState
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more