pub struct CheckpointLog { /* private fields */ }Expand description
One instance’s checkpoint history on disk.
Implementations§
Source§impl CheckpointLog
impl CheckpointLog
Sourcepub fn new(dir: Utf8PathBuf, instance: &str) -> Self
pub fn new(dir: Utf8PathBuf, instance: &str) -> Self
dir is .newgit/checkpoints/<slug>/; instance is only for errors.
Sourcepub fn list(&self) -> Result<Vec<CheckpointRecord>>
pub fn list(&self) -> Result<Vec<CheckpointRecord>>
Records in creation order (numeric id order).
pub fn load(&self, id: &str) -> Result<CheckpointRecord>
pub fn latest(&self) -> Result<CheckpointRecord>
pub fn save(&self, record: &CheckpointRecord) -> Result<Utf8PathBuf>
pub fn save_recovery(&self, record: &RecoveryRecord) -> Result<Utf8PathBuf>
Trait Implementations§
Source§impl Clone for CheckpointLog
impl Clone for CheckpointLog
Source§fn clone(&self) -> CheckpointLog
fn clone(&self) -> CheckpointLog
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CheckpointLog
impl RefUnwindSafe for CheckpointLog
impl Send for CheckpointLog
impl Sync for CheckpointLog
impl Unpin for CheckpointLog
impl UnsafeUnpin for CheckpointLog
impl UnwindSafe for CheckpointLog
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