Trait xstack_kad::syscall::DriverKadStore

source ·
pub trait DriverKadStore: Sync + Send {
    // Required methods
    fn insert<'life0, 'async_trait>(
        &'life0 self,
        key: KBucketKey,
        record: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn remove<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 KBucketKey,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 KBucketKey,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A trait that provides functions to access peer informations.

Required Methods§

source

fn insert<'life0, 'async_trait>( &'life0 self, key: KBucketKey, record: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

insert a new kad record.

source

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

remove record by key.

source

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

Get the record by key.

Implementors§