pub trait StorageBackend: Send + Sync {
// Required methods
fn list(&self, prefix: &str) -> Result<Vec<String>>;
fn get(&self, key: &str) -> Result<Bytes>;
fn put(&self, key: &str, data: Bytes) -> Result<()>;
fn delete(&self, key: &str) -> Result<()>;
fn exists(&self, key: &str) -> Result<bool>;
fn size(&self, key: &str) -> Result<u64>;
}Expand description
A storage backend for reading and writing data.
Backends abstract the underlying storage mechanism, allowing datasets and registries to work with local files, cloud storage, or in-memory buffers using the same interface.
§Async Design
All operations are synchronous for now (v0.1). Future versions will
add async variants behind the tokio-runtime feature flag.
Required Methods§
Sourcefn list(&self, prefix: &str) -> Result<Vec<String>>
fn list(&self, prefix: &str) -> Result<Vec<String>>
Lists all keys with the given prefix.
Returns a vector of key names (relative to the backend root).
§Errors
Returns an error if the listing operation fails.
Sourcefn get(&self, key: &str) -> Result<Bytes>
fn get(&self, key: &str) -> Result<Bytes>
Reads data from the given key.
§Errors
Returns an error if the key does not exist or cannot be read.
Sourcefn put(&self, key: &str, data: Bytes) -> Result<()>
fn put(&self, key: &str, data: Bytes) -> Result<()>
Writes data to the given key.
Creates parent directories/prefixes as needed.
§Errors
Returns an error if the write fails.