Skip to main content

RestorationStore

Trait RestorationStore 

Source
pub trait RestorationStore:
    Send
    + Sync
    + 'static {
    // Required methods
    fn load(&self) -> Result<Option<Vec<u8>>, RestorationStoreError>;
    fn save(&self, bytes: &[u8]) -> Result<(), RestorationStoreError>;
    fn remove(&self) -> Result<(), RestorationStoreError>;

    // Provided method
    fn location(&self) -> Option<PathBuf> { ... }
}
Expand description

Small persistence boundary for restoration snapshots. Implementations must leave the previous valid snapshot untouched when save returns an error.

Required Methods§

Provided Methods§

Source

fn location(&self) -> Option<PathBuf>

Returns a human-readable location when one exists. In-memory stores intentionally return None.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§