Skip to main content

UnixFsStore

Trait UnixFsStore 

Source
pub trait UnixFsStore {
    // Required methods
    fn contains(&self, cid: &Cid) -> bool;
    fn get(&self, cid: &Cid) -> Option<Vec<u8>>;
    fn put(&self, cid: Cid, data: Vec<u8>) -> usize;
}
Expand description

Minimal block store interface for UnixFS operations.

Simpler than ObjectStoreExt (which deals in typed EncryptedBlobs). UnixFS blocks are unencrypted DAG-PB/raw nodes — they go through this trait directly.

Required Methods§

Source

fn contains(&self, cid: &Cid) -> bool

Check if a block exists.

Source

fn get(&self, cid: &Cid) -> Option<Vec<u8>>

Get a block’s raw bytes.

Source

fn put(&self, cid: Cid, data: Vec<u8>) -> usize

Store a block. Returns the block size in bytes.

Implementors§