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, Global>, Self::Error>;
    fn list_databases(
        &self,
        schema: &SchemaName
    ) -> Result<Vec<String, Global>, Self::Error>;
    fn list_stored(
        &self,
        schema: &SchemaName,
        database_name: &str,
        container: &str
    ) -> Result<Vec<String, Global>, Self::Error>;
    fn load(
        &self,
        schema: &SchemaName,
        database_name: &str,
        container: &str,
        name: &str
    ) -> Result<Vec<u8, Global>, Self::Error>;
}
Expand description

A location to store and restore a database from.

Required Associated Types§

type Error: AnyError

The error type for the backup location.

Required Methods§

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

Store object at path with name.

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

Lists all of the schemas stored in this backup location.

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

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

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

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

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

Load a previously stored object from path with name.

Implementations on Foreign Types§

§

impl BackupLocation for PathBuf

§

type Error = Error

§

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

§

fn list_schemas( &self ) -> Result<Vec<SchemaName, Global>, <PathBuf as BackupLocation>::Error>

§

fn list_databases( &self, schema: &SchemaName ) -> Result<Vec<String, Global>, <PathBuf as BackupLocation>::Error>

§

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

§

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

§

impl BackupLocation for Path

§

type Error = Error

§

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

§

fn list_schemas( &self ) -> Result<Vec<SchemaName, Global>, <Path as BackupLocation>::Error>

§

fn list_databases( &self, schema: &SchemaName ) -> Result<Vec<String, Global>, <Path as BackupLocation>::Error>

§

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

§

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

Implementors§