Trait bonsaidb::local::BackupLocation
source · 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§
Required Methods§
sourcefn store(
&self,
schema: &SchemaName,
database_name: &str,
container: &str,
name: &str,
object: &[u8]
) -> Result<(), Self::Error>
fn store( &self, schema: &SchemaName, database_name: &str, container: &str, name: &str, object: &[u8] ) -> Result<(), Self::Error>
Store object
at path
with name
.
sourcefn list_schemas(&self) -> Result<Vec<SchemaName>, Self::Error>
fn list_schemas(&self) -> Result<Vec<SchemaName>, Self::Error>
Lists all of the schemas stored in this backup location.
sourcefn list_databases(
&self,
schema: &SchemaName
) -> Result<Vec<String>, Self::Error>
fn list_databases( &self, schema: &SchemaName ) -> Result<Vec<String>, Self::Error>
List all of the names of the databases stored for schema
.
sourcefn list_stored(
&self,
schema: &SchemaName,
database_name: &str,
container: &str
) -> Result<Vec<String>, Self::Error>
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.