pub trait DhtPersistentStorage:
    Send
    + Sync
    + 'static
    + Clone {
    // Required methods
    fn save<'life0, 'async_trait>(
        &'life0 self,
        _records: Vec<SerializableRecord>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn load<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SerializableRecord>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A trait that we use to save and load the DHT to a file on disk or other storage medium

Required Methods§

source

fn save<'life0, 'async_trait>( &'life0 self, _records: Vec<SerializableRecord>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Save the DHT (as a list of serializable records) to the persistent storage

§Errors
  • If we fail to save the DHT to the persistent storage provider
source

fn load<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<SerializableRecord>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load the DHT (as a list of serializable records) from the persistent storage

§Errors
  • If we fail to load the DHT from the persistent storage provider

Object Safety§

This trait is not object safe.

Implementors§