Skip to main content

StoreMaintenance

Trait StoreMaintenance 

Source
pub trait StoreMaintenance: MaybeSend + MaybeSync {
    // Required methods
    fn layout_version(&self) -> u32;
    fn migrate(
        &self,
    ) -> impl Future<Output = Result<u32, StoreError>> + MaybeSend;
    fn backup_to(
        &self,
        dest: &str,
    ) -> impl Future<Output = Result<(), StoreError>> + MaybeSend;
}
Expand description

Backend-defined maintenance (R-19). Optional: the pipeline never calls it. SQLite implements it with versioned physical migrations and VACUUM INTO (M0-09); another backend may implement it however it likes, and every backend still has the portable export above.

Required Methods§

Source

fn layout_version(&self) -> u32

The backend’s physical layout version (its schema, e.g. SQLite’s user_version); independent of keys::LAYOUT_VERSION.

Source

fn migrate(&self) -> impl Future<Output = Result<u32, StoreError>> + MaybeSend

Migrate the physical layout to the version this binary expects; returns the version reached. Idempotent.

Source

fn backup_to( &self, dest: &str, ) -> impl Future<Output = Result<(), StoreError>> + MaybeSend

Write a consistent backend-native backup to dest, a location the backend defines (a file path, a bucket URL).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§