Blocks

Trait Blocks 

Source
pub trait Blocks: Send + Sync {
    // Required methods
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cid: &'life1 Cid<64>,
        options: Option<GetBlockOptions>,
    ) -> Pin<Box<dyn Future<Output = Result<Bytes, HeliaError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn get_many_cids<'life0, 'async_trait>(
        &'life0 self,
        cids: Vec<Cid<64>>,
        options: Option<GetManyOptions>,
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Pair, HeliaError>> + Send>>, HeliaError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn get_all<'life0, 'async_trait>(
        &'life0 self,
        options: Option<GetAllOptions>,
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Pair> + Send>>, HeliaError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn put<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cid: &'life1 Cid<64>,
        block: Bytes,
        options: Option<PutBlockOptions>,
    ) -> Pin<Box<dyn Future<Output = Result<Cid<64>, HeliaError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn put_many_blocks<'life0, 'async_trait>(
        &'life0 self,
        blocks: Vec<InputPair>,
        options: Option<PutManyOptions>,
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Cid<64>> + Send>>, HeliaError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn has<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cid: &'life1 Cid<64>,
        options: Option<HasOptions>,
    ) -> Pin<Box<dyn Future<Output = Result<bool, HeliaError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn has_many_cids<'life0, 'async_trait>(
        &'life0 self,
        cids: Vec<Cid<64>>,
        options: Option<HasOptions>,
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = bool> + Send>>, HeliaError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn delete_many_cids<'life0, 'async_trait>(
        &'life0 self,
        cids: Vec<Cid<64>>,
        options: Option<DeleteManyOptions>,
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Cid<64>> + Send>>, HeliaError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Block storage interface

Required Methods§

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, cid: &'life1 Cid<64>, options: Option<GetBlockOptions>, ) -> Pin<Box<dyn Future<Output = Result<Bytes, HeliaError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Retrieve a block from the blockstore

Source

fn get_many_cids<'life0, 'async_trait>( &'life0 self, cids: Vec<Cid<64>>, options: Option<GetManyOptions>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Pair, HeliaError>> + Send>>, HeliaError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Retrieve multiple blocks from the blockstore

Source

fn get_all<'life0, 'async_trait>( &'life0 self, options: Option<GetAllOptions>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Pair> + Send>>, HeliaError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Retrieve all blocks from the blockstore

Source

fn put<'life0, 'life1, 'async_trait>( &'life0 self, cid: &'life1 Cid<64>, block: Bytes, options: Option<PutBlockOptions>, ) -> Pin<Box<dyn Future<Output = Result<Cid<64>, HeliaError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Store a block in the blockstore

Source

fn put_many_blocks<'life0, 'async_trait>( &'life0 self, blocks: Vec<InputPair>, options: Option<PutManyOptions>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Cid<64>> + Send>>, HeliaError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Store multiple blocks in the blockstore

Source

fn has<'life0, 'life1, 'async_trait>( &'life0 self, cid: &'life1 Cid<64>, options: Option<HasOptions>, ) -> Pin<Box<dyn Future<Output = Result<bool, HeliaError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Check if blocks exist in the blockstore

Source

fn has_many_cids<'life0, 'async_trait>( &'life0 self, cids: Vec<Cid<64>>, options: Option<HasOptions>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = bool> + Send>>, HeliaError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Check if multiple blocks exist in the blockstore

Source

fn delete_many_cids<'life0, 'async_trait>( &'life0 self, cids: Vec<Cid<64>>, options: Option<DeleteManyOptions>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Cid<64>> + Send>>, HeliaError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Delete multiple blocks from the blockstore

Implementors§