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
sourceimpl Clone for GetRecordOk
impl Clone for GetRecordOk
sourcefn clone(&self) -> GetRecordOk
fn clone(&self) -> GetRecordOk
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more