pub struct CheckpointManager { /* private fields */ }Expand description
Checkpoint manager for handling save/load operations
Implementations§
Source§impl CheckpointManager
impl CheckpointManager
Sourcepub fn new<P: AsRef<Path>>(
checkpoint_dir: P,
options: CheckpointOptions,
) -> TorshResult<Self>
pub fn new<P: AsRef<Path>>( checkpoint_dir: P, options: CheckpointOptions, ) -> TorshResult<Self>
Create a new checkpoint manager
Sourcepub fn save_checkpoint(
&mut self,
data: CheckpointData,
name: Option<String>,
) -> TorshResult<PathBuf>
pub fn save_checkpoint( &mut self, data: CheckpointData, name: Option<String>, ) -> TorshResult<PathBuf>
Save a checkpoint
Sourcepub fn load_checkpoint<P: AsRef<Path>>(
&self,
path: P,
) -> TorshResult<CheckpointData>
pub fn load_checkpoint<P: AsRef<Path>>( &self, path: P, ) -> TorshResult<CheckpointData>
Load a checkpoint
Sourcepub fn load_latest_checkpoint(&self) -> TorshResult<Option<CheckpointData>>
pub fn load_latest_checkpoint(&self) -> TorshResult<Option<CheckpointData>>
Load the latest checkpoint
Sourcepub fn list_checkpoints(&self) -> Vec<PathBuf>
pub fn list_checkpoints(&self) -> Vec<PathBuf>
List all checkpoints
Sourcepub fn delete_checkpoint<P: AsRef<Path>>(&mut self, path: P) -> TorshResult<()>
pub fn delete_checkpoint<P: AsRef<Path>>(&mut self, path: P) -> TorshResult<()>
Delete a checkpoint
Sourcepub fn get_checkpoint_metadata<P: AsRef<Path>>(
&self,
path: P,
) -> TorshResult<CheckpointMetadata>
pub fn get_checkpoint_metadata<P: AsRef<Path>>( &self, path: P, ) -> TorshResult<CheckpointMetadata>
Get checkpoint metadata without loading full checkpoint
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
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