pub struct BackupEngine { /* private fields */ }Expand description
Engine that creates, lists, restores, verifies and prunes backups.
Each backup is stored as a pair of files:
<id>.dat— the (possibly compressed) triple data<id>.json— theBackupManifest
Implementations§
Source§impl BackupEngine
impl BackupEngine
Sourcepub fn new(backup_dir: PathBuf, max_backups: usize) -> Self
pub fn new(backup_dir: PathBuf, max_backups: usize) -> Self
Create a new BackupEngine rooted at backup_dir.
Sourcepub fn create_backup(
&self,
triples: &[(String, String, String)],
dataset_name: &str,
format: BackupFormat,
compression: BackupCompression,
) -> Result<BackupManifest>
pub fn create_backup( &self, triples: &[(String, String, String)], dataset_name: &str, format: BackupFormat, compression: BackupCompression, ) -> Result<BackupManifest>
Create a backup of triples and write it to the backup directory.
Sourcepub fn list_backups(&self) -> Vec<BackupManifest>
pub fn list_backups(&self) -> Vec<BackupManifest>
List all manifests in the backup directory, sorted newest-first.
Sourcepub fn restore(&self, backup_id: &str) -> Result<Vec<(String, String, String)>>
pub fn restore(&self, backup_id: &str) -> Result<Vec<(String, String, String)>>
Restore triples from the backup identified by backup_id.
Sourcepub fn verify(&self, backup_id: &str) -> Result<bool>
pub fn verify(&self, backup_id: &str) -> Result<bool>
Verify a backup by re-computing its SHA-256 checksum.
Returns true if the stored checksum matches.
Sourcepub fn delete_backup(&self, backup_id: &str) -> Result<()>
pub fn delete_backup(&self, backup_id: &str) -> Result<()>
Delete the backup identified by backup_id.
Auto Trait Implementations§
impl Freeze for BackupEngine
impl RefUnwindSafe for BackupEngine
impl Send for BackupEngine
impl Sync for BackupEngine
impl Unpin for BackupEngine
impl UnsafeUnpin for BackupEngine
impl UnwindSafe for BackupEngine
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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