pub trait StreamStore: Store {
// Required methods
fn has_object(&self, checksum: &str) -> Result<bool, StoreError>;
fn get_object(&self, checksum: &str) -> Result<Vec<u8>, StoreError>;
fn put_object(
&self,
checksum: &str,
bytes: Vec<u8>,
) -> Result<(), StoreError>;
fn put_manifest(
&self,
id: &str,
manifest: &Manifest,
) -> Result<(), StoreError>;
}Expand description
Raw, content-addressed object/manifest streaming on top of a Store.
See the module docs for the store-to-store sync motivation
and the verification invariants. The Store supertrait means every
implementor also offers get_manifest,
fetch_files, and push.
Required Methods§
Sourcefn has_object(&self, checksum: &str) -> Result<bool, StoreError>
fn has_object(&self, checksum: &str) -> Result<bool, StoreError>
Returns true if an object with this content-address already exists in
the store.
This is the existence check a store-to-store orchestrator uses to skip re-copying blobs the destination already holds. It does not read or verify the object body.
§Errors
StoreError::Io / StoreError::Backend on transport failure.
Sourcefn get_object(&self, checksum: &str) -> Result<Vec<u8>, StoreError>
fn get_object(&self, checksum: &str) -> Result<Vec<u8>, StoreError>
Reads the raw object blob filed under checksum, verifying its bytes
hash (BLAKE3) back to checksum before returning them.
§Errors
StoreError::ObjectNotFoundif no object is stored atchecksum.StoreError::Integrityif the stored bytes do not hash tochecksum(the blob is corrupt or tampered).StoreError::Io/StoreError::Backendon transport failure.
Sourcefn put_object(&self, checksum: &str, bytes: Vec<u8>) -> Result<(), StoreError>
fn put_object(&self, checksum: &str, bytes: Vec<u8>) -> Result<(), StoreError>
Writes a raw object blob at its content-address, verifying bytes hash
(BLAKE3) to checksum before storing anything.
A mismatch stores nothing and returns an error, so a corrupt blob can never land at a content-address it does not belong to.
§Errors
StoreError::Integrityifbytesdo not hash tochecksum.StoreError::Io/StoreError::Backendon transport failure.
Sourcefn put_manifest(&self, id: &str, manifest: &Manifest) -> Result<(), StoreError>
fn put_manifest(&self, id: &str, manifest: &Manifest) -> Result<(), StoreError>
Writes the manifest object for id, verifying the manifest’s bytes hash
back to id before storing it.
This is the final step of a store-to-store copy: it is written only after
every referenced object has landed, so a manifest is never observable
before the content it references (mirroring push).
§Errors
StoreError::Integrityif the manifest does not hash toid.StoreError::Io/StoreError::Backendon transport failure.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".