StorageSnapshot

Trait StorageSnapshot 

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

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

Required Methods§

Source

fn export_snapshot(&self) -> BoxStream<'static, Result<SnapshotData>>

Export a snapshot of the storage.

Source

fn import_snapshot<'life0, 'async_trait>( &'life0 self, snapshot: BoxStream<'static, Result<SnapshotData>>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: '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§