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
A query initiated by Kademlia::bootstrap
.
GetClosestPeers
A query initiated by Kademlia::get_closest_peers
.
GetProviders
Fields
A query initiated by Kademlia::get_providers
.
AddProvider
Fields
§
phase: AddProviderPhase
The current phase of the query.
§
context: AddProviderContext
The execution context of the query.
A (repeated) query initiated by Kademlia::start_providing
.
PutRecord
Fields
§
quorum: NonZeroUsize
The expected quorum of responses w.r.t. the replication factor.
§
phase: PutRecordPhase
The current phase of the query.
§
context: PutRecordContext
The execution context of the query.
A (repeated) query initiated by Kademlia::put_record
.
GetRecord
Fields
§
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: NonZeroUsize
The number of records to look for.
A query initiated by Kademlia::get_record
.