Skip to main content

PinApi

Trait PinApi 

Source
pub trait PinApi {
    // Required methods
    fn add<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        cid: &'life1 Cid,
        options: PinOptions,
    ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn remove<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        cid: &'life1 Cid,
    ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn is_pinned<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cid: &'life1 Cid,
    ) -> Pin<Box<dyn Future<Output = Option<PinKind>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn iter<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Box<dyn Iterator<Item = (Cid, PinKind)>>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Storage Pin API.

Required Methods§

Source

fn add<'life0, 'life1, 'async_trait>( &'life0 mut self, cid: &'life1 Cid, options: PinOptions, ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create new pin.

Source

fn remove<'life0, 'life1, 'async_trait>( &'life0 mut self, cid: &'life1 Cid, ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove pin.

Source

fn is_pinned<'life0, 'life1, 'async_trait>( &'life0 self, cid: &'life1 Cid, ) -> Pin<Box<dyn Future<Output = Option<PinKind>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns whether the CID is pinned.

Source

fn iter<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Box<dyn Iterator<Item = (Cid, PinKind)>>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all pins.

Implementors§