Enum libp2p_kad::QueryInfo
source · [−]pub enum QueryInfo {
Bootstrap {
peer: PeerId,
remaining: Option<IntoIter<Key<PeerId>>>,
},
GetClosestPeers {
key: Vec<u8>,
},
GetProviders {
key: Key,
providers: HashSet<PeerId>,
},
AddProvider {
key: Key,
phase: AddProviderPhase,
context: AddProviderContext,
},
PutRecord {
record: Record,
quorum: NonZeroUsize,
phase: PutRecordPhase,
context: PutRecordContext,
},
GetRecord {
key: Key,
records: Vec<PeerRecord>,
quorum: NonZeroUsize,
cache_candidates: BTreeMap<Distance, PeerId>,
},
}Expand description
Information about a running query.
Variants
Bootstrap
Fields
peer: PeerIdThe targeted peer ID.
A query initiated by Kademlia::bootstrap.
GetClosestPeers
A query initiated by Kademlia::get_closest_peers.
GetProviders
Fields
key: KeyThe key for which to search for providers.
A query initiated by Kademlia::get_providers.
AddProvider
Fields
key: KeyThe record key.
phase: AddProviderPhaseThe current phase of the query.
context: AddProviderContextThe execution context of the query.
A (repeated) query initiated by Kademlia::start_providing.
PutRecord
Fields
record: Recordquorum: NonZeroUsizeThe expected quorum of responses w.r.t. the replication factor.
phase: PutRecordPhaseThe current phase of the query.
context: PutRecordContextThe execution context of the query.
A (repeated) query initiated by Kademlia::put_record.
GetRecord
Fields
key: KeyThe key to look for.
records: Vec<PeerRecord>The records with the id of the peer that returned them. None when
the record was found in the local store.
quorum: NonZeroUsizeThe number of records to look for.
A query initiated by Kademlia::get_record.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for QueryInfo
impl Send for QueryInfo
impl Sync for QueryInfo
impl Unpin for QueryInfo
impl UnwindSafe for QueryInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
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.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more