Module routing_table

Source

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::INCOMPATIBLE_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ยง

bucket ๐Ÿ”’
entry ๐Ÿ”’

Structsยง

RoutingTable
This is a modified version of the Kademlia Distributed Hash Table (DHT). https://en.wikipedia.org/wiki/Kademlia

Enumsยง

AddEntryResult
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ยง

subnet_match ๐Ÿ”’
Check if two addresses belong to the same subnet.