pub trait BackupLocation: Send + Sync {
    type Error: AnyError;

    // Required methods
    fn store(
        &self,
        schema: &SchemaName,
        database_name: &str,
        container: &str,
        name: &str,
        object: &[u8]
    ) -> Result<(), Self::Error>;
    fn list_schemas(&self) -> Result<Vec<SchemaName>, Self::Error>;
    fn list_databases(
        &self,
        schema: &SchemaName
    ) -> Result<Vec<String>, Self::Error>;
    fn list_stored(
        &self,
        schema: &SchemaName,
        database_name: &str,
        container: &str
    ) -> Result<Vec<String>, Self::Error>;
    fn load(
        &self,
        schema: &SchemaName,
        database_name: &str,
        container: &str,
        name: &str
    ) -> Result<Vec<u8>, Self::Error>;
}
Expand description

A location to store and restore a database from.

Required Associated Types§

source

type Error: AnyError

The error type for the backup location.

Required Methods§

source

fn store( &self, schema: &SchemaName, database_name: &str, container: &str, name: &str, object: &[u8] ) -> Result<(), Self::Error>

Store object at path with name.

source

fn list_schemas(&self) -> Result<Vec<SchemaName>, Self::Error>

Lists all of the schemas stored in this backup location.

source

fn list_databases( &self, schema: &SchemaName ) -> Result<Vec<String>, Self::Error>

List all of the names of the databases stored for schema.

source

fn list_stored( &self, schema: &SchemaName, database_name: &str, container: &str ) -> Result<Vec<String>, Self::Error>

List all stored named objects at path. The names should be the same that were provided when store() was called.

source

fn load( &self, schema: &SchemaName, database_name: &str, container: &str, name: &str ) -> Result<Vec<u8>, Self::Error>

Load a previously stored object from path with name.

Implementations on Foreign Types§

source§

impl BackupLocation for Path

§

type Error = Error

source§

fn store( &self, schema: &SchemaName, database_name: &str, container: &str, name: &str, object: &[u8] ) -> Result<(), Self::Error>

source§

fn list_schemas(&self) -> Result<Vec<SchemaName>, Self::Error>

source§

fn list_databases( &self, schema: &SchemaName ) -> Result<Vec<String>, Self::Error>

source§

fn list_stored( &self, schema: &SchemaName, database_name: &str, container: &str ) -> Result<Vec<String>, Self::Error>

source§

fn load( &self, schema: &SchemaName, database_name: &str, container: &str, name: &str ) -> Result<Vec<u8>, Self::Error>

source§

impl BackupLocation for PathBuf

§

type Error = Error

source§

fn store( &self, schema: &SchemaName, database_name: &str, container: &str, name: &str, object: &[u8] ) -> Result<(), Self::Error>

source§

fn list_schemas(&self) -> Result<Vec<SchemaName>, Self::Error>

source§

fn list_databases( &self, schema: &SchemaName ) -> Result<Vec<String>, Self::Error>

source§

fn list_stored( &self, schema: &SchemaName, database_name: &str, container: &str ) -> Result<Vec<String>, Self::Error>

source§

fn load( &self, schema: &SchemaName, database_name: &str, container: &str, name: &str ) -> Result<Vec<u8>, Self::Error>

Implementors§