/// Stores a copy of all data in this instance to `location`.
Stores a copy of all data in this instance to `location`.
Stores a copy of all data in this instance to ` location ` .
pub async fn restore<L: AnyBackupLocation>(&self, location: L) -> Result<(), Error> {
        for schema in location
            .list_schemas()
            .await
            .map_err(|err| Error::Backup(Box::new(err)))?
        {
            for database in location
                .list_databases(&schema)
                .await
                .map_err(|err| Error::Backup(Box::new(err)))?
            {
                // The admin database is already going to be created by the process of creating a database.
                self.create_database_with_schema(&database, schema.clone(), true)
                    .await?;
                let database = self.database_without_schema(&database).await?;
                self.restore_database(&database, &location).await?;
            }
        }
        Ok(())
    }
pub async fn restore < L : AnyBackupLocation > ( & self , location : L ) -> Result < ( ) , Error > { for schema in location . list_schemas ( ) . await . map_err ( | err | Error :: Backup ( Box :: new ( err ) ) ) ? { for database in location . list_databases ( & schema ) . await . map_err ( | err | Error :: Backup ( Box :: new ( err ) ) ) ? { // The admin database is already going to be created by the process of creating a database. self . create_database_with_schema ( & database , schema . clone ( ) , true ) . await ? ; let database = self . database_without_schema ( & database ) . await ? ; self . restore_database ( & database , & location ) . await ? ; } } Ok ( ( ) ) }
Stores a copy of all data in this instance to `location`.
Stores a copy of all data in this instance to ` location ` .
&self
location
L