pub trait RemoteBackend: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn download(
&self,
remote_key: &str,
local_path: &Path,
) -> Result<bool, BackendError>;
fn upload(
&self,
local_path: &Path,
remote_key: &str,
) -> Result<(), BackendError>;
fn exists(&self, remote_key: &str) -> Result<bool, BackendError>;
fn delete(&self, remote_key: &str) -> Result<(), BackendError>;
fn list(&self, prefix: &str) -> Result<Vec<String>, BackendError>;
}Expand description
Trait for remote storage backends.
Implementations handle downloading and uploading database snapshots to/from remote storage. Operations are blocking (called during attach/reclaim lifecycle phases, not in hot query paths).
Required Methods§
Sourcefn download(
&self,
remote_key: &str,
local_path: &Path,
) -> Result<bool, BackendError>
fn download( &self, remote_key: &str, local_path: &Path, ) -> Result<bool, BackendError>
Download a remote object to a local file path.
Returns Ok(true) if downloaded, Ok(false) if remote object doesn’t exist.
Sourcefn upload(
&self,
local_path: &Path,
remote_key: &str,
) -> Result<(), BackendError>
fn upload( &self, local_path: &Path, remote_key: &str, ) -> Result<(), BackendError>
Upload a local file to remote storage.
Sourcefn exists(&self, remote_key: &str) -> Result<bool, BackendError>
fn exists(&self, remote_key: &str) -> Result<bool, BackendError>
Check if a remote object exists.