feat(swarm): remove deprecated IntoConnectionHandler

This removes the deprecated `IntoConnectionHandler` trait and all its implementations. Consequently, `NetworkBehaviour::new_handler` and `NetworkBehaviour::addresses_of_peer` are now gone and the two `handle_` functions are now required to implement.

Related: #3647.

Pull-Request: #3884.
This commit is contained in:
Thomas Eizinger
2023-05-08 10:30:29 +02:00
committed by GitHub
parent b4e724dd72
commit 0e36c7c072
15 changed files with 38 additions and 371 deletions

View File

@ -47,7 +47,7 @@ pub struct Behaviour {
/// Hold addresses of all peers that we have discovered so far.
///
/// Storing these internally allows us to assist the [`libp2p_swarm::Swarm`] in dialing by returning addresses from [`NetworkBehaviour::addresses_of_peer`].
/// Storing these internally allows us to assist the [`libp2p_swarm::Swarm`] in dialing by returning addresses from [`NetworkBehaviour::handle_pending_outbound_connection`].
discovered_peers: HashMap<(PeerId, Namespace), Vec<Multiaddr>>,
/// Tracks the expiry of registrations that we have discovered and stored in `discovered_peers` otherwise we have a memory leak.