[][src]Trait asuran::manifest::target::BackupTarget

pub trait BackupTarget<T: Read>: Clone + Send + Sync {
#[must_use]
    fn backup_paths<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Listing> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn backup_object<'life0, 'async_trait>(
        &'life0 self,
        node: Node
    ) -> Pin<Box<dyn Future<Output = HashMap<String, BackupObject<T>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn backup_listing<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Listing> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

Collection of methods that a backup driver has to implement in order for a generic backup driver to be able to commit its objects to a repository

As the work of commiting objects to an archive may be split among several threads, it is important that the target use a shared state among clones and be tread safe

Required methods

#[must_use] fn backup_paths<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Listing> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Returns a listing of all the backup-able objects in the target's domain

This function does not do anything to the internal listing, and

#[must_use] fn backup_object<'life0, 'async_trait>(
    &'life0 self,
    node: Node
) -> Pin<Box<dyn Future<Output = HashMap<String, BackupObject<T>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Takes a path and returns a reader for the path this object represents

Returns a hash-map of namespaces and Objects to be inserted in each namespace

The "raw data" for a backup target shuold be stored in the root namespace, represented here as the empty string. This is to allow almost any coherent data to be restored directly onto the filesystem

Additional pieces of metatdata, such as filesystem permissions should be stored in a namespace roughly matching the path of the datastructure that represents them, e.g. filesystem:permissions:

#[must_use] fn backup_listing<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Listing> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Returns a serialized listing that should be stored in an archive at archive:listing

Loading content...

Implementors

impl BackupTarget<File> for FileSystemTarget[src]

Loading content...