[−][src]Module discv5::kbucket
Implementation of a Kademlia routing table as used by a single peer participating in a Kademlia DHT.
The entry point for the API of this module is a KBucketsTable
.
Pending Insertions
When the bucket associated with the Key
of an inserted entry is full
but contains disconnected nodes, it accepts a PendingEntry
.
Pending entries are inserted lazily when their timeout is found to be expired
upon querying the KBucketsTable
. When that happens, the KBucketsTable
records
an AppliedPending
result which must be consumed by calling take_applied_pending
regularly and / or after performing lookup operations like entry
and closest
.
Re-exports
pub use entry::*; |
Modules
bucket | The internal API for a single |
entry | The |
key |
Structs
BucketIndex | A (type-safe) index into a |
ClosestBucketsIter | An iterator over the bucket indices, in the order determined by the |
ClosestIter | An iterator over (some projection of) the closest entries in a
|
KBucketsTable | A |
PredicateKey | A key that can be returned from the |
Enums
ClosestBucketsIterState | Operating states of a |
Constants
MAX_NODES_PER_SUBNET_TABLE | Number of permitted nodes in the same /24 subnet |
NUM_BUCKETS | Maximum number of k-buckets. |