mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-25 17:01:20 +00:00
In earlier iterations of the design for generic connection management, we removed the `ConnectionId::new` constructor because it would have allowed users to create `ConnectionId`s that are already taken, thus breaking invariants that `NetworkBehaviour`s rely on. Later, we incorporated the creation of `ConnectionId` in `DialOpts` which mitigates this risk altogether. Thus, it is reasonably safe to introduce a public, non-deprecated constructor for `ConnectionId` that can be used for tests. Related https://github.com/libp2p/rust-libp2p/pull/3327#issuecomment-1469870307. Pull-Request: #3652.