Skip to main content

PeerStorage

Trait PeerStorage 

Source
pub trait PeerStorage: Send + Sync {
    // Required methods
    fn get_blob<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 BlobId,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_peer_root<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Read-only storage operations needed by a storage-aware peer.

The separate trait makes a backend that implements both BlobStore and RootStore usable as one trait object in crate::ConnectConfig.

Required Methods§

Source

fn get_blob<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 BlobId, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Loads one immutable blob.

Source

fn get_peer_root<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Loads one named root record.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<S> PeerStorage for S
where S: BlobStore + RootStore + Send + Sync,