pub trait ObjectStore {
// Required methods
fn put(
&mut self,
uri: &FabricUri,
data: &[u8],
opts: Option<PutOptions>,
) -> Result<()>;
fn get(&self, uri: &FabricUri) -> Result<Option<ObjectData>>;
fn head(&self, uri: &FabricUri) -> Result<Option<ObjectInfo>>;
fn delete(&mut self, uri: &FabricUri) -> Result<bool>;
fn list(
&self,
pool: &str,
bucket: &str,
prefix: &str,
) -> Result<Vec<String>>;
}Expand description
Universal object storage trait.
Implementations provide storage backends (memory, block, tiered). All writes compute and store a CRC32 checksum; all reads verify it.
Required Methods§
Sourcefn put(
&mut self,
uri: &FabricUri,
data: &[u8],
opts: Option<PutOptions>,
) -> Result<()>
fn put( &mut self, uri: &FabricUri, data: &[u8], opts: Option<PutOptions>, ) -> Result<()>
Store an object at the given URI.
If the object already exists, it is overwritten. The CRC32 checksum
is computed from data and stored in the object metadata.
Sourcefn get(&self, uri: &FabricUri) -> Result<Option<ObjectData>>
fn get(&self, uri: &FabricUri) -> Result<Option<ObjectData>>
Retrieve an object by URI.
Returns None if the object does not exist. On a successful read,
the CRC32 checksum is verified against the stored value.
Sourcefn head(&self, uri: &FabricUri) -> Result<Option<ObjectInfo>>
fn head(&self, uri: &FabricUri) -> Result<Option<ObjectInfo>>
Retrieve object metadata without reading the data.