Re-exportsยง
pub use bucket::Bucket;pub use bucket::BucketEntry;pub use bucket::EntryStatusFlag;pub use bucket::CONNECTED_ENTRY;pub use bucket::DISCONNECTED_ENTRY;pub use bucket::PENDING_ENTRY;pub use bucket::UNREACHABLE_ENTRY;pub use bucket::UNSTABLE_ENTRY;pub use entry::xor_distance;pub use entry::Entry;pub use entry::Key;
Modulesยง
Structsยง
- Routing
Table - This is a modified version of the Kademlia Distributed Hash Table (DHT). https://en.wikipedia.org/wiki/Kademlia
Enumsยง
- AddEntry
Result - Represents the possible result when adding a new entry.
Constantsยง
- DISTANCE_
LIMIT ๐ - The distance limit for the closest buckets.
- MAX_
MATCHED_ ๐SUBNET_ IN_ BUCKET - The maximum number of matched subnets allowed within a single bucket.
- MAX_
MATCHED_ ๐SUBNET_ IN_ TABLE - The maximum number of matched subnets across the entire routing table.
- TABLE_
SIZE ๐ - The total number of buckets in the routing table.
Functionsยง
- is_
loopback_ ๐pair - True if both addresses are IPv4 or IPv6 loopback.
- matches_
local ๐ - True if
peerโs advertised bloom is acceptable to a local node whose bloom ismine. Peer must cover every mandatory bit and, when optional is non-empty, share at least one optional bit. An emptyminematches everything. - subnet_
match ๐ - Check if two addresses belong to the same subnet.
- subnet_
restricted ๐ - Iterate the buckets and count entries in the same subnet as
entry. Restricted if same-bucket matches >= MAX_MATCHED_SUBNET_IN_BUCKET or table-wide matches >= MAX_MATCHED_SUBNET_IN_TABLE.