Struct ruplicity::Backup

source ·
pub struct Backup<B> { /* private fields */ }
Expand description

A top level representation of a duplicity backup.

Implementations§

source§

impl<B: Backend> Backup<B>

source

pub fn new(backend: B) -> Result<Self>

Opens an existig backup by using the given backend.

Errors

This function will return an error whenever the backend returns an error in a file operation. If the backend can’t provide access to backup files, because they are unavailable or non-existing, an empty backup could be returned.

Examples
use ruplicity::Backup;
use ruplicity::backend::local::LocalBackend;

// use the local backend to open a path in the file system containing a backup
let backend = LocalBackend::new("tests/backups/single_vol");
let backup = Backup::new(backend).unwrap();
println!("Got backup with {} snapshots!", backup.snapshots().unwrap().count());
source

pub fn snapshots(&self) -> Result<Snapshots<'_>>

Constructs an iterator over the snapshots currently present in this backup.

Trait Implementations§

source§

impl<B: Debug> Debug for Backup<B>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<B> !RefUnwindSafe for Backup<B>

§

impl<B> Send for Backup<B>where B: Send,

§

impl<B> !Sync for Backup<B>

§

impl<B> Unpin for Backup<B>where B: Unpin,

§

impl<B> UnwindSafe for Backup<B>where B: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.