Enum libp2p_kad::QueryInfo [−][src]
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
A query initiated by Kademlia::bootstrap
.
Fields of Bootstrap
A query initiated by Kademlia::get_closest_peers
.
A query initiated by Kademlia::get_providers
.
Fields of GetProviders
A (repeated) query initiated by Kademlia::start_providing
.
Fields of AddProvider
key: Key
The record key.
phase: AddProviderPhase
The current phase of the query.
context: AddProviderContext
The execution context of the query.
A (repeated) query initiated by Kademlia::put_record
.
Fields of PutRecord
record: Record
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 query initiated by Kademlia::get_record
.
Fields of GetRecord
key: Key
The 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: NonZeroUsize
The number of records to look for.
cache_candidates: BTreeMap<Distance, PeerId>
The peers closest to the key
that were queried but did not return a record,
i.e. the peers that are candidates for caching the record.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for QueryInfo
impl UnwindSafe for QueryInfo
Blanket Implementations
Mutably borrows from an owned value. Read more