Struct dht::KNodeTable [] [src]

pub struct KNodeTable<TId> { /* fields omitted */ }

Kademlia node table.

Keeps nodes in a number of k-buckets (equal to bit size of ID in a system, usually 160), where N-th k-bucket contains nodes with distance from 2N to 2N+1 from our node.

Methods

impl<TId> KNodeTable<TId> where TId: GenericId
[src]

Create a new node table.

this_id -- ID of the current node (used to calculate metrics).

Trait Implementations

impl<TId> GenericNodeTable<TId> for KNodeTable<TId> where TId: GenericId
[src]

Generate suitable random ID.

Store or update node in the table.

Find given number of node, closest to given ID.

Pop expired or the oldest nodes from table for inspection.