Skip to main content

RemoteStore

Trait RemoteStore 

Source
pub trait RemoteStore {
    // Required methods
    fn fetch<B: EncryptedBlob>(&self, cid: &VoidCid) -> Result<B>;
    fn push<B: EncryptedBlob>(&self, blob: &B) -> Result<VoidCid>;
    fn exists(&self, cid: &VoidCid) -> Result<bool>;
    fn pin(&self, cid: &VoidCid) -> Result<()>;
}
Expand description

Remote content-addressed storage.

All reads and writes go through typed encrypted blobs. Implementations handle CID verification internally — callers receive verified, typed blobs.

Required Methods§

Source

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

Fetch a typed encrypted blob by CID.

Implementations must verify the fetched content matches the CID before returning.

Source

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

Push a typed encrypted blob, returning its CID.

Implementations must verify the returned CID matches the blob content.

Source

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

Check if a blob exists on the remote.

Source

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

Pin a blob to prevent remote garbage collection.

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§