Expand description
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_keys
.
Re-exports§
pub use crate::handler::ConnectionDirection;
pub use super::ConnectionDirection;
Structs§
- An entry that is not present in any bucket.
- The result of applying a pending node to a bucket, possibly replacing an existing node.
- Closest Iterator Output Value
- A distance between two
Key
s. - An immutable by-reference view of a bucket entry.
- A cloned, immutable view of an entry that is either present in a bucket or pending insertion.
- A
KBucketsTable
represents a Kademlia routing table. - A
Key
is a cryptographic hash, identifying both the nodes participating in the Kademlia DHT, as well as records stored in the DHT. - A
Node
in a bucket, representing a peer participating in the Kademlia DHT together with an associated value (e.g. contact information). - An immutable by-reference view of a
Node
. - The status of a node in a bucket.
- An entry waiting for a slot to be available in a bucket.
- A key that can be returned from the
closest_keys
function, which indicates if the key matches the predicate or not. - A value being returned from a predicate closest iterator.
- An entry present in a bucket.
Enums§
- The result of inserting an entry into a bucket.
- The connection state of a node.
- A reference into a single entry of a
KBucketsTable
. - A reason for failing to update or insert a node into the bucket.
- Informs if the record was inserted.
- The result of inserting an entry into a bucket.
- The result of performing an update on a kbucket/table.
Constants§
- Maximum number of nodes in a bucket, i.e. the (fixed)
k
parameter.