pub struct RecoveryStore { /* private fields */ }Implementations§
Source§impl RecoveryStore
impl RecoveryStore
pub fn new(spec: RecoverySpec, state_dir: &Path) -> Self
pub fn path(&self) -> &Path
pub fn save( &self, snapshot: &str, broker: &PathBroker, ) -> Result<(), ShellError>
Sourcepub fn load(&self, broker: &PathBroker) -> Result<Option<String>, ShellError>
pub fn load(&self, broker: &PathBroker) -> Result<Option<String>, ShellError>
The saved snapshot, if any. Recovered file paths are re-granted (best effort: a file deleted since the crash simply is not granted).
Sourcepub fn migrate_legacy(
&self,
legacy: &Path,
) -> Result<MigrationOutcome, ShellError>
pub fn migrate_legacy( &self, legacy: &Path, ) -> Result<MigrationOutcome, ShellError>
One-time migration of a snapshot an earlier version wrote to legacy.
The legacy file is validated (size and version) and copied atomically to the current path,
then removed. Authority is not re-checked here: RecoveryStore::save and
RecoveryStore::load still apply it. An invalid legacy file is an error and is left in
place. If the current snapshot already exists, the legacy file is left alone.
pub fn clear(&self) -> Result<(), ShellError>
Auto Trait Implementations§
impl !RefUnwindSafe for RecoveryStore
impl !UnwindSafe for RecoveryStore
impl Freeze for RecoveryStore
impl Send for RecoveryStore
impl Sync for RecoveryStore
impl Unpin for RecoveryStore
impl UnsafeUnpin for RecoveryStore
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