Struct libp2p_kad::GetRecordOk
source · [−]pub struct GetRecordOk {
pub records: Vec<PeerRecord>,
pub cache_candidates: BTreeMap<Distance, PeerId>,
}
Expand description
The successful result of Kademlia::get_record
.
Fields
records: Vec<PeerRecord>
The records found, including the peer that returned them.
cache_candidates: BTreeMap<Distance, PeerId>
If caching is enabled, these are the peers closest
to the record key (not the local node) that were queried but
did not return the record, sorted by distance to the record key
from closest to farthest. How many of these are tracked is configured
by KademliaConfig::set_caching
. If the lookup used a quorum of
1, these peers will be sent the record as a means of caching.
If the lookup used a quorum > 1, you may wish to use these
candidates with Kademlia::put_record_to
after selecting
one of the returned records.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for GetRecordOk
impl Send for GetRecordOk
impl Sync for GetRecordOk
impl Unpin for GetRecordOk
impl UnwindSafe for GetRecordOk
Blanket Implementations
Mutably borrows from an owned value. Read more