[][src]Module libp2p_kad::kbucket

Key-value storage, with a refresh and a time-to-live system.

A k-buckets table allows one to store a value identified by keys, ordered by their distance to a reference key passed to the constructor.

If the local ID has N bits, then the k-buckets table contains N buckets each containing a constant number of entries. Storing a key in the k-buckets table adds it to the bucket corresponding to its distance with the reference key.

Structs

Bucket

Access to a bucket.

BucketsIter

Iterator giving access to a bucket.

KBucketsTable

Table of k-buckets.

Enums

Update

Return value of the set_connected() method.

Constants

MAX_NODES_PER_BUCKET

Maximum number of nodes in a bucket.

Traits

KBucketsPeerId

Trait that must be implemented on types that can be used as an identifier in a k-bucket.