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

pub trait RestoreTarget<T: Write>: Clone + Send + Sync {
#[must_use]
    fn load_listing<'life0, 'async_trait>(
        root_path: &'life0 str,
        listing: Listing
    ) -> Pin<Box<dyn Future<Output = Self> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn restore_listing<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Listing> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn restore_object<'life0, 'async_trait>(
        &'life0 self,
        path: Node
    ) -> Pin<Box<dyn Future<Output = HashMap<String, RestoreObject<T>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

Collection of methods that a restore target has to implement in order for a generic restore driver to be able to load and properly restore its objects from a repository.

As the work of restoring an archive should be split among serveral threads, it is important that targets be thread-aware and thread safe.Into

Required methods

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

Loads an object listing and creates a new restore target from it

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

Returns a copy of the internal listing object

This should almost always be a clone of the object you fed into load_listing

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

Takes an object path

Returns a hashmap, keyed by namespace, of the various parts of this object

Loading content...

Implementors

impl RestoreTarget<File> for FileSystemTarget[src]

Loading content...