pub struct BackupManager { /* private fields */ }Expand description
Manages zip-based backups for mods and plugin load orders.
Implementations§
Source§impl BackupManager
impl BackupManager
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create a new backup manager rooted at the default backup directory.
Sourcepub fn create_mod_backup(
&self,
mod_id: &ModId,
mod_dir: &Path,
) -> Result<BackupEntry>
pub fn create_mod_backup( &self, mod_id: &ModId, mod_dir: &Path, ) -> Result<BackupEntry>
Create a backup of a mod directory, stored as a zip file.
Sourcepub fn restore_mod_backup(
&self,
mod_id: &ModId,
dest_dir: &Path,
) -> Result<BackupEntry>
pub fn restore_mod_backup( &self, mod_id: &ModId, dest_dir: &Path, ) -> Result<BackupEntry>
Restore a mod from its latest backup zip into dest_dir.
Sourcepub fn list_mod_backups(&self, mod_id: &ModId) -> Result<Vec<BackupEntry>>
pub fn list_mod_backups(&self, mod_id: &ModId) -> Result<Vec<BackupEntry>>
List available backups for a mod, sorted oldest-first.
Sourcepub fn backup_plugin_order(
&self,
profile: &str,
game: &GameId,
plugins: &[PluginEntry],
) -> Result<PathBuf>
pub fn backup_plugin_order( &self, profile: &str, game: &GameId, plugins: &[PluginEntry], ) -> Result<PathBuf>
Backup the plugin load order for a profile+game as a JSON file.
Sourcepub fn restore_plugin_order(
&self,
profile: &str,
game: &GameId,
) -> Result<Vec<PluginEntry>>
pub fn restore_plugin_order( &self, profile: &str, game: &GameId, ) -> Result<Vec<PluginEntry>>
Restore the most recent plugin load order backup for a profile+game.
Auto Trait Implementations§
impl Freeze for BackupManager
impl RefUnwindSafe for BackupManager
impl Send for BackupManager
impl Sync for BackupManager
impl Unpin for BackupManager
impl UnsafeUnpin for BackupManager
impl UnwindSafe for BackupManager
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