[][src]Trait ipfs_embed_core::Storage

pub trait Storage<S: StoreParams>: Send + Sync + 'static {
    type Subscription: Stream<Item = StorageEvent> + Send + Unpin;
    pub fn contains(&self, cid: &Cid) -> Result<bool>;
pub fn get(&self, cid: &Cid) -> Result<Option<Vec<u8>>>;
pub fn insert(&self, block: &Block<S>) -> Result<()>;
#[must_use] pub fn alias<'life0, 'life1, 'async_trait, T: AsRef<[u8]> + Send + Sync>(
        &'life0 self,
        alias: T,
        cid: Option<&'life1 Cid>
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
pub fn resolve<T: AsRef<[u8]> + Send + Sync>(
        &self,
        alias: T
    ) -> Result<Option<Cid>>;
#[must_use] pub fn pinned<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cid: &'life1 Cid
    ) -> Pin<Box<dyn Future<Output = Result<Option<bool>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
pub fn subscribe(&self) -> Self::Subscription; }

Associated Types

type Subscription: Stream<Item = StorageEvent> + Send + Unpin[src]

Loading content...

Required methods

pub fn contains(&self, cid: &Cid) -> Result<bool>[src]

pub fn get(&self, cid: &Cid) -> Result<Option<Vec<u8>>>[src]

pub fn insert(&self, block: &Block<S>) -> Result<()>[src]

#[must_use]pub fn alias<'life0, 'life1, 'async_trait, T: AsRef<[u8]> + Send + Sync>(
    &'life0 self,
    alias: T,
    cid: Option<&'life1 Cid>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

pub fn resolve<T: AsRef<[u8]> + Send + Sync>(
    &self,
    alias: T
) -> Result<Option<Cid>>
[src]

#[must_use]pub fn pinned<'life0, 'life1, 'async_trait>(
    &'life0 self,
    cid: &'life1 Cid
) -> Pin<Box<dyn Future<Output = Result<Option<bool>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

pub fn subscribe(&self) -> Self::Subscription[src]

Loading content...

Implementors

Loading content...