Module libp2p_kad::kbucket

source ·
Expand description

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

Access to a bucket.
Iterator giving access to a bucket.
Table of k-buckets.

Enums

Return value of the update() method.

Constants

Maximum number of nodes in a bucket.

Traits

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