pub struct SnapshotManager { /* private fields */ }Expand description
Snapshot manager for saving and restoring system states
Manages snapshots stored in a directory structure:
~/.mockforge/snapshots/{workspace_id}/{snapshot_name}/
Implementations§
Source§impl SnapshotManager
impl SnapshotManager
Sourcepub fn new(base_dir: Option<PathBuf>) -> Self
pub fn new(base_dir: Option<PathBuf>) -> Self
Create a new snapshot manager
Defaults to ~/.mockforge/snapshots if no base directory is provided.
Sourcepub async fn save_snapshot(
&self,
name: String,
description: Option<String>,
workspace_id: String,
components: SnapshotComponents,
consistency_engine: Option<&ConsistencyEngine>,
) -> Result<SnapshotManifest>
pub async fn save_snapshot( &self, name: String, description: Option<String>, workspace_id: String, components: SnapshotComponents, consistency_engine: Option<&ConsistencyEngine>, ) -> Result<SnapshotManifest>
Save a snapshot of the current system state
This creates a snapshot directory and saves all specified components.
Sourcepub async fn load_snapshot(
&self,
name: String,
workspace_id: String,
components: Option<SnapshotComponents>,
consistency_engine: Option<&ConsistencyEngine>,
) -> Result<SnapshotManifest>
pub async fn load_snapshot( &self, name: String, workspace_id: String, components: Option<SnapshotComponents>, consistency_engine: Option<&ConsistencyEngine>, ) -> Result<SnapshotManifest>
Load a snapshot and restore system state
Restores the specified components from a snapshot.
Sourcepub async fn list_snapshots(
&self,
workspace_id: &str,
) -> Result<Vec<SnapshotMetadata>>
pub async fn list_snapshots( &self, workspace_id: &str, ) -> Result<Vec<SnapshotMetadata>>
List all snapshots for a workspace
Sourcepub async fn delete_snapshot(
&self,
name: String,
workspace_id: String,
) -> Result<()>
pub async fn delete_snapshot( &self, name: String, workspace_id: String, ) -> Result<()>
Delete a snapshot
Sourcepub async fn get_snapshot_info(
&self,
name: String,
workspace_id: String,
) -> Result<SnapshotManifest>
pub async fn get_snapshot_info( &self, name: String, workspace_id: String, ) -> Result<SnapshotManifest>
Get snapshot information
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SnapshotManager
impl RefUnwindSafe for SnapshotManager
impl Send for SnapshotManager
impl Sync for SnapshotManager
impl Unpin for SnapshotManager
impl UnwindSafe for SnapshotManager
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