Trait StorageSnapshot

Source
pub trait StorageSnapshot {
    // Required methods
    fn export_snapshot(
        &self,
    ) -> Pin<Box<dyn Stream<Item = Result<SnapshotData, Report>> + Send>>;
    fn import_snapshot<'life0, 'async_trait>(
        &'life0 self,
        snapshot: Pin<Box<dyn Stream<Item = Result<SnapshotData, Report>> + Send>>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

A trait for storages that support exporting and importing snapshots of their data.

Required Methods§

Source

fn export_snapshot( &self, ) -> Pin<Box<dyn Stream<Item = Result<SnapshotData, Report>> + Send>>

Export a snapshot of the storage.

Source

fn import_snapshot<'life0, 'async_trait>( &'life0 self, snapshot: Pin<Box<dyn Stream<Item = Result<SnapshotData, Report>> + Send>>, ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Import a snapshot of the storage.

The snapshot stream must be consumed to completion.

Whether data is overwritten or merged is up to the implementation.

Implementors§