use crate::error::EdgestoreError;
pub trait RemoteStore: Send + Sync {
fn upload(&self, hash: &[u8; 32], data: &[u8]) -> Result<(), EdgestoreError>;
fn download(&self, hash: &[u8; 32]) -> Result<Vec<u8>, EdgestoreError>;
fn list(&self) -> Result<Vec<[u8; 32]>, EdgestoreError>;
fn delete(&self, hash: &[u8; 32]) -> Result<(), EdgestoreError>;
fn upload_aux(
&self,
hash: &[u8; 32],
ext: &str,
data: &[u8],
) -> Result<(), EdgestoreError> {
let _ = (hash, ext, data);
Err(EdgestoreError::InvalidOperation(
"upload_aux not implemented for this RemoteStore".to_string(),
))
}
fn download_aux(&self, hash: &[u8; 32], ext: &str) -> Result<Vec<u8>, EdgestoreError> {
let _ = (hash, ext);
Err(EdgestoreError::InvalidOperation(
"download_aux not implemented for this RemoteStore".to_string(),
))
}
}