pub struct GenericSnapshotManager<T: SnapshotTarget> { /* private fields */ }Expand description
Generic snapshot manager that works with any SnapshotTarget
Implementations§
Source§impl<T: SnapshotTarget> GenericSnapshotManager<T>
impl<T: SnapshotTarget> GenericSnapshotManager<T>
pub fn new(base_dir: PathBuf) -> Self
Sourcepub fn save(
&self,
target: &T,
trigger: SnapshotTrigger,
message: Option<&str>,
profiles_affected: &[String],
) -> Result<Snapshot>
pub fn save( &self, target: &T, trigger: SnapshotTrigger, message: Option<&str>, profiles_affected: &[String], ) -> Result<Snapshot>
Save a snapshot of the target
Sourcepub fn diff(&self, target: &T, id: &str) -> Result<SnapshotDiff>
pub fn diff(&self, target: &T, id: &str) -> Result<SnapshotDiff>
Compare snapshot with current state
Source§impl GenericSnapshotManager<TargetDir>
impl GenericSnapshotManager<TargetDir>
Sourcepub fn save_target(
&self,
target: &Path,
trigger: SnapshotTrigger,
message: Option<&str>,
profiles_affected: &[String],
) -> Result<Snapshot>
pub fn save_target( &self, target: &Path, trigger: SnapshotTrigger, message: Option<&str>, profiles_affected: &[String], ) -> Result<Snapshot>
Save a snapshot of a target directory
Sourcepub fn list_target(&self, target: &Path) -> Result<Vec<Snapshot>>
pub fn list_target(&self, target: &Path) -> Result<Vec<Snapshot>>
List snapshots for a target directory
Sourcepub fn get_target(&self, target: &Path, id: &str) -> Result<Snapshot>
pub fn get_target(&self, target: &Path, id: &str) -> Result<Snapshot>
Get a specific snapshot for a target directory
Sourcepub fn restore_target(&self, target: &Path, id: &str) -> Result<(usize, usize)>
pub fn restore_target(&self, target: &Path, id: &str) -> Result<(usize, usize)>
Restore a snapshot to a target directory
Sourcepub fn diff_target(&self, target: &Path, id: &str) -> Result<SnapshotDiff>
pub fn diff_target(&self, target: &Path, id: &str) -> Result<SnapshotDiff>
Compare snapshot with current target state
Source§impl GenericSnapshotManager<ProfileDir>
impl GenericSnapshotManager<ProfileDir>
Sourcepub fn save_profile(
&self,
profile_name: &str,
profile_path: &Path,
message: Option<&str>,
) -> Result<Snapshot>
pub fn save_profile( &self, profile_name: &str, profile_path: &Path, message: Option<&str>, ) -> Result<Snapshot>
Save a snapshot of a profile
Sourcepub fn list_profile(&self, profile_name: &str) -> Result<Vec<Snapshot>>
pub fn list_profile(&self, profile_name: &str) -> Result<Vec<Snapshot>>
List snapshots for a profile
Sourcepub fn get_profile(&self, profile_name: &str, id: &str) -> Result<Snapshot>
pub fn get_profile(&self, profile_name: &str, id: &str) -> Result<Snapshot>
Get a specific snapshot for a profile
Sourcepub fn restore_profile(
&self,
profile_name: &str,
profile_path: &Path,
id: &str,
) -> Result<(usize, usize)>
pub fn restore_profile( &self, profile_name: &str, profile_path: &Path, id: &str, ) -> Result<(usize, usize)>
Restore a snapshot to a profile directory
Sourcepub fn diff_profile(
&self,
profile_name: &str,
profile_path: &Path,
id: &str,
) -> Result<SnapshotDiff>
pub fn diff_profile( &self, profile_name: &str, profile_path: &Path, id: &str, ) -> Result<SnapshotDiff>
Compare snapshot with current profile state
Auto Trait Implementations§
impl<T> Freeze for GenericSnapshotManager<T>
impl<T> RefUnwindSafe for GenericSnapshotManager<T>where
T: RefUnwindSafe,
impl<T> Send for GenericSnapshotManager<T>where
T: Send,
impl<T> Sync for GenericSnapshotManager<T>where
T: Sync,
impl<T> Unpin for GenericSnapshotManager<T>where
T: Unpin,
impl<T> UnsafeUnpin for GenericSnapshotManager<T>
impl<T> UnwindSafe for GenericSnapshotManager<T>where
T: UnwindSafe,
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