Skip to content

Commit

Permalink
docs: fix last OutboundQueryCompleted in kad doc
Browse files Browse the repository at this point in the history
`OutboundQueryCompleted` hasn't been fully replaced by `OutboundQueryProgressed` in kad doc.

Pull-Request: #4257.
  • Loading branch information
thomas-senechal authored Aug 2, 2023
1 parent fbf35e1 commit 4d637ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions protocols/kad/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@

[PR 4224]: https://github.com/libp2p/rust-libp2p/pull/4224

- Rename missed `KademliaEvent::OutboundQueryCompleted` to `KademliaEvent::OutboundQueryProgressed` in documentation.
See [PR 4257].

[PR 4257]: https://github.com/libp2p/rust-libp2p/pull/4257

## 0.44.2

- Allow to explicitly set `Mode::{Client,Server}`.
Expand Down
12 changes: 6 additions & 6 deletions protocols/kad/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ where
/// Initiates an iterative query for the closest peers to the given key.
///
/// The result of the query is delivered in a
/// [`KademliaEvent::OutboundQueryCompleted{QueryResult::GetClosestPeers}`].
/// [`KademliaEvent::OutboundQueryProgressed{QueryResult::GetClosestPeers}`].
pub fn get_closest_peers<K>(&mut self, key: K) -> QueryId
where
K: Into<kbucket::Key<K>> + Into<Vec<u8>> + Clone,
Expand All @@ -692,7 +692,7 @@ where
/// Performs a lookup for a record in the DHT.
///
/// The result of this operation is delivered in a
/// [`KademliaEvent::OutboundQueryCompleted{QueryResult::GetRecord}`].
/// [`KademliaEvent::OutboundQueryProgressed{QueryResult::GetRecord}`].
pub fn get_record(&mut self, key: record_priv::Key) -> QueryId {
let record = if let Some(record) = self.store.get(&key) {
if record.is_expired(Instant::now()) {
Expand Down Expand Up @@ -753,7 +753,7 @@ where
/// Returns `Ok` if a record has been stored locally, providing the
/// `QueryId` of the initial query that replicates the record in the DHT.
/// The result of the query is eventually reported as a
/// [`KademliaEvent::OutboundQueryCompleted{QueryResult::PutRecord}`].
/// [`KademliaEvent::OutboundQueryProgressed{QueryResult::PutRecord}`].
///
/// The record is always stored locally with the given expiration. If the record's
/// expiration is `None`, the common case, it does not expire in local storage
Expand Down Expand Up @@ -869,7 +869,7 @@ where
///
/// Returns `Ok` if bootstrapping has been initiated with a self-lookup, providing the
/// `QueryId` for the entire bootstrapping process. The progress of bootstrapping is
/// reported via [`KademliaEvent::OutboundQueryCompleted{QueryResult::Bootstrap}`] events,
/// reported via [`KademliaEvent::OutboundQueryProgressed{QueryResult::Bootstrap}`] events,
/// with one such event per bootstrapping query.
///
/// Returns `Err` if bootstrapping is impossible due an empty routing table.
Expand Down Expand Up @@ -913,7 +913,7 @@ where
/// of the libp2p Kademlia provider API.
///
/// The results of the (repeated) provider announcements sent by this node are
/// reported via [`KademliaEvent::OutboundQueryCompleted{QueryResult::StartProviding}`].
/// reported via [`KademliaEvent::OutboundQueryProgressed{QueryResult::StartProviding}`].
pub fn start_providing(&mut self, key: record_priv::Key) -> Result<QueryId, store::Error> {
// Note: We store our own provider records locally without local addresses
// to avoid redundant storage and outdated addresses. Instead these are
Expand Down Expand Up @@ -950,7 +950,7 @@ where
/// Performs a lookup for providers of a value to the given key.
///
/// The result of this operation is delivered in a
/// reported via [`KademliaEvent::OutboundQueryCompleted{QueryResult::GetProviders}`].
/// reported via [`KademliaEvent::OutboundQueryProgressed{QueryResult::GetProviders}`].
pub fn get_providers(&mut self, key: record_priv::Key) -> QueryId {
let providers: HashSet<_> = self
.store
Expand Down

0 comments on commit 4d637ae

Please sign in to comment.