Enum libp2p::kad::QueryInfo [−][src]
pub enum QueryInfo {
Bootstrap {
peer: PeerId,
remaining: Option<IntoIter<Key<PeerId>, Global>>,
},
GetClosestPeers {
key: Vec<u8, Global>,
},
GetProviders {
key: Key,
providers: HashSet<PeerId, RandomState>,
},
AddProvider {
key: Key,
phase: AddProviderPhase,
context: AddProviderContext,
},
PutRecord {
record: Record,
quorum: NonZeroUsize,
phase: PutRecordPhase,
context: PutRecordContext,
},
GetRecord {
key: Key,
records: Vec<PeerRecord, Global>,
quorum: NonZeroUsize,
cache_at: Option<Key<PeerId>>,
},
}Information about a running query.
Variants
A query initiated by Kademlia::bootstrap.
Show fields
Fields of Bootstrap
A query initiated by Kademlia::get_closest_peers.
A query initiated by Kademlia::get_providers.
Show fields
Fields of GetProviders
key: KeyThe key for which to search for providers.
providers: HashSet<PeerId, RandomState>The found providers.
A (repeated) query initiated by Kademlia::start_providing.
Show fields
Fields of AddProvider
key: KeyThe record key.
phase: AddProviderPhaseThe current phase of the query.
context: AddProviderContextThe execution context of the query.
A (repeated) query initiated by Kademlia::put_record.
Show fields
Fields of PutRecord
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 query initiated by Kademlia::get_record.
Show fields
Fields of GetRecord
key: KeyThe key to look for.
records: Vec<PeerRecord, Global>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.
cache_at: Option<Key<PeerId>>The closest peer to key that did not return a record.
When a record is found in a standard Kademlia query (quorum == 1), it is cached at this peer as soon as a record is found.