Skip to main content

BlockStorageContentMapping

Trait BlockStorageContentMapping 

Source
pub trait BlockStorageContentMapping: Send + Sync {
    // Provided methods
    fn is_content_mapped<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn to_plain<'life0, 'life1, 'async_trait>(
        &'life0 self,
        mapped: &'life1 Cid,
    ) -> Pin<Box<dyn Future<Output = Option<Cid>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn to_mapped<'life0, 'life1, 'async_trait>(
        &'life0 self,
        plain: &'life1 Cid,
    ) -> Pin<Box<dyn Future<Output = Option<Cid>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn insert_mappings<'life0, 'async_trait>(
        &'life0 self,
        mappings: BTreeSet<MappedCid>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Map Cids between mappend and plain.

Plain:

  • External.
  • The Cid stored on disk.
  • For example a Encrypted Block.

Mapped:

  • Internal.
  • The Cid used for references.
  • Unencrypted.

Provided Methods§

Source

fn is_content_mapped<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Whether the mapping is active.

Source

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

Convert the mapped Cid to an plain storage Cid.

Source

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

Convert the plain storage Cid to a mapped Cid.

Source

fn insert_mappings<'life0, 'async_trait>( &'life0 self, mappings: BTreeSet<MappedCid>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Insert mappings explicitly into storage.

Implementors§