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_at: Option<Key<PeerId>>,
},
}
Expand description
Information about a running query.
Variants
Bootstrap
Fields
peer: PeerId
The targeted peer ID.
A query initiated by Kademlia::bootstrap
.
GetClosestPeers
A query initiated by Kademlia::get_closest_peers
.
GetProviders
Fields
key: Key
The key for which to search for providers.
A query initiated by Kademlia::get_providers
.
AddProvider
Fields
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::start_providing
.
PutRecord
Fields
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 (repeated) query initiated by Kademlia::put_record
.
GetRecord
Fields
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.
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 · 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