Skip to content

Commit 8671761

Browse files
committed
feat(kad): make Distance private field public
1 parent b187c14 commit 8671761

File tree

6 files changed

+11
-6
lines changed

6 files changed

+11
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ libp2p-floodsub = { version = "0.45.0", path = "protocols/floodsub" }
8383
libp2p-gossipsub = { version = "0.48.0", path = "protocols/gossipsub" }
8484
libp2p-identify = { version = "0.46.0", path = "protocols/identify" }
8585
libp2p-identity = { version = "0.2.10" }
86-
libp2p-kad = { version = "0.47.0", path = "protocols/kad" }
86+
libp2p-kad = { version = "0.47.1", path = "protocols/kad" }
8787
libp2p-mdns = { version = "0.46.0", path = "protocols/mdns" }
8888
libp2p-memory-connection-limits = { version = "0.3.1", path = "misc/memory-connection-limits" }
8989
libp2p-metrics = { version = "0.15.0", path = "misc/metrics" }

protocols/kad/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.47.1
2+
3+
- Expose Distance private field U256 to public.
4+
See [PR 5705](https://github.com/libp2p/rust-libp2p/pull/5705).
5+
16
## 0.47.0
27

38
- Expose a kad query facility allowing specify num_results dynamicaly.

protocols/kad/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "libp2p-kad"
33
edition = "2021"
44
rust-version = { workspace = true }
55
description = "Kademlia protocol for libp2p"
6-
version = "0.47.0"
6+
version = "0.47.1"
77
authors = ["Parity Technologies <[email protected]>"]
88
license = "MIT"
99
repository = "https://github.com/libp2p/rust-libp2p"

protocols/kad/src/kbucket/key.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use crate::record;
3535

3636
construct_uint! {
3737
/// 256-bit unsigned integer.
38-
pub(super) struct U256(4);
38+
pub struct U256(4);
3939
}
4040

4141
/// A `Key` in the DHT keyspace with preserved preimage.
@@ -193,7 +193,7 @@ impl AsRef<KeyBytes> for KeyBytes {
193193

194194
/// A distance between two keys in the DHT keyspace.
195195
#[derive(Copy, Clone, PartialEq, Eq, Default, PartialOrd, Ord, Debug)]
196-
pub struct Distance(pub(super) U256);
196+
pub struct Distance(pub U256);
197197

198198
impl Distance {
199199
/// Returns the integer part of the base 2 logarithm of the [`Distance`].

protocols/kad/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub use behaviour::{
6767
QueryResult, QueryStats, Quorum, RoutingUpdate, StoreInserts,
6868
};
6969
pub use kbucket::{
70-
Distance as KBucketDistance, EntryView, KBucketRef, Key as KBucketKey, NodeStatus,
70+
Distance as KBucketDistance, EntryView, KBucketRef, Key as KBucketKey, NodeStatus, U256,
7171
};
7272
use libp2p_swarm::StreamProtocol;
7373
pub use protocol::{ConnectionType, KadPeer};

0 commit comments

Comments
 (0)