Skip to main content

ObjectStoreExt

Trait ObjectStoreExt 

Source
pub trait ObjectStoreExt {
    // Required methods
    fn put_blob<B: EncryptedBlob>(&self, blob: &B) -> Result<VoidCid>;
    fn get_blob<B: EncryptedBlob>(&self, cid: &VoidCid) -> Result<B>;
    fn get_blob_verified<B: EncryptedBlob>(&self, cid: &VoidCid) -> Result<B>;
    fn exists(&self, cid: &VoidCid) -> Result<bool>;
    fn remove(&self, cid: &VoidCid) -> Result<()>;
}
Expand description

Typed object store API.

All reads and writes go through typed encrypted blobs, enforcing correct AAD at the encryption boundary. No raw &[u8] in or out.

Required Methods§

Source

fn put_blob<B: EncryptedBlob>(&self, blob: &B) -> Result<VoidCid>

Store a typed encrypted blob, returning its CID.

Source

fn get_blob<B: EncryptedBlob>(&self, cid: &VoidCid) -> Result<B>

Retrieve a typed encrypted blob by CID.

No CID hash verification — AES-GCM’s auth tag provides integrity when the blob is decrypted.

Source

fn get_blob_verified<B: EncryptedBlob>(&self, cid: &VoidCid) -> Result<B>

Retrieve a typed encrypted blob with CID hash verification.

Re-hashes the content and verifies it matches the CID. Use for audit/fsck where CID integrity must be verified independent of decryption.

Source

fn exists(&self, cid: &VoidCid) -> Result<bool>

Checks if an object exists by CID.

Source

fn remove(&self, cid: &VoidCid) -> Result<()>

Removes an object by CID.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: ObjectStore + ?Sized> ObjectStoreExt for T