[][src]Trait lib3h::dht::dht_trait::Dht

pub trait Dht {
    fn get_peer_list(&self) -> Vec<PeerData>;
fn get_peer(&self, peer_address: &str) -> Option<PeerData>;
fn this_peer(&self) -> &PeerData;
fn get_entry_address_list(&self) -> Vec<&Address>;
fn get_aspects_of(&self, entry_address: &Address) -> Option<Vec<Address>>;
fn post(&mut self, cmd: DhtCommand) -> Lib3hResult<()>;
fn process(&mut self) -> Lib3hResult<(DidWork, Vec<DhtEvent>)>; }

Allow storage and retrieval of peer & entry data. Trait API is for querying local dht data DhtCommand is for mutating storage or network/async queries

Required methods

fn get_peer_list(&self) -> Vec<PeerData>

Peer info

fn get_peer(&self, peer_address: &str) -> Option<PeerData>

fn this_peer(&self) -> &PeerData

fn get_entry_address_list(&self) -> Vec<&Address>

Entry

fn get_aspects_of(&self, entry_address: &Address) -> Option<Vec<Address>>

fn post(&mut self, cmd: DhtCommand) -> Lib3hResult<()>

Processing

fn process(&mut self) -> Lib3hResult<(DidWork, Vec<DhtEvent>)>

Loading content...

Implementors

impl Dht for MirrorDht[src]

Impl Dht interface

fn post(&mut self, cmd: DhtCommand) -> Lib3hResult<()>[src]

Add to inbox

fn process(&mut self) -> Lib3hResult<(DidWork, Vec<DhtEvent>)>[src]

Serve each item in inbox

impl Dht for RrDht[src]

impl<T: Transport, D: Dht> Dht for P2pGateway<T, D>[src]

Compose DHT

fn get_peer_list(&self) -> Vec<PeerData>[src]

Peer info

fn get_entry_address_list(&self) -> Vec<&Address>[src]

Entry

fn post(&mut self, cmd: DhtCommand) -> Lib3hResult<()>[src]

Processing

Loading content...