pub enum KademliaBucketInserts {
    OnConnected,
    Manual,
}
Expand description

The configurable strategies for the insertion of peers and their addresses into the k-buckets of the Kademlia routing table.

Variants§

§

OnConnected

Whenever a connection to a peer is established as a result of a dialing attempt and that peer is not yet in the routing table, it is inserted as long as there is a free slot in the corresponding k-bucket. If the k-bucket is full but still has a free pending slot, it may be inserted into the routing table at a later time if an unresponsive disconnected peer is evicted from the bucket.

§

Manual

New peers and addresses are only added to the routing table via explicit calls to Kademlia::add_address.

Note: Even though peers can only get into the routing table as a result of Kademlia::add_address, routing table entries are still updated as peers connect and disconnect (i.e. the order of the entries as well as the network addresses).

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.