Thomas Eizinger f4ce1fe9ae
swarm/pool: Misc refactoring (#3073)
* Remove unreachable error case

Instead of taking the connection out of the map again, construct
the event to be returned with the data we already have available.

* Remove `Pool::get` and `PoolConnection`

These are effectively not used.

* Replace `iter_pending_info` with its only usage: `is_dialing`

* Add `is_for_same_remote_as` convenience function

* Remove `PendingConnection`

* Rename `PendingConnectionInfo` to `PendingConnection`

With the latter being gone, the name is now free.

* Merge `EstablishedConnectionInfo` and `EstablishedConnection`

This is a leftover from when `Pool` was still in `libp2p-core` and
one of them was a public API and the other one wasn't.

All of this is private to `libp2p-swarm` so we no longer need to
differentiate.

* Don't `pub use` out of `pub(crate)` modules
2022-11-02 18:47:00 +00:00
..
2022-11-02 18:47:00 +00:00