use crate::StorageBackend;
use std::path::Path;
pub async fn backup(backend: &dyn StorageBackend, dest: &Path) -> anyhow::Result<()> {
if let Some(path) = backend.as_filesystem_path() {
return crate::backends::filesystem::backup::backup_fs_dir(path, dest).await;
}
Err(anyhow::anyhow!(
"backup: not yet supported for this backend type (only filesystem is supported)"
))
}
pub async fn restore(backend: &dyn StorageBackend, src: &Path) -> anyhow::Result<()> {
if let Some(path) = backend.as_filesystem_path() {
return crate::backends::filesystem::backup::restore_fs_dir(src, path).await;
}
Err(anyhow::anyhow!(
"restore: not yet supported for this backend type (only filesystem is supported)"
))
}