mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-28 17:21:34 +00:00
Remove ConnectionInfo trait (#1813)
In all cases, we pass the PeerId directly as the connection info. The flexbility of doing something different here was originally envisioned but turned out to be never needed. For reference see: https://github.com/libp2p/rust-libp2p/issues/1798#issuecomment-714526056 Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
@ -31,8 +31,6 @@ use futures::prelude::*;
|
||||
use futures::stream::FuturesUnordered;
|
||||
use libp2p_core::{
|
||||
Multiaddr,
|
||||
PeerId,
|
||||
ConnectionInfo,
|
||||
Connected,
|
||||
connection::{
|
||||
ConnectionHandler,
|
||||
@ -65,18 +63,17 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<TIntoProtoHandler, TProtoHandler, TConnInfo> IntoConnectionHandler<TConnInfo>
|
||||
impl<TIntoProtoHandler, TProtoHandler> IntoConnectionHandler
|
||||
for NodeHandlerWrapperBuilder<TIntoProtoHandler>
|
||||
where
|
||||
TIntoProtoHandler: IntoProtocolsHandler<Handler = TProtoHandler>,
|
||||
TProtoHandler: ProtocolsHandler,
|
||||
TConnInfo: ConnectionInfo<PeerId = PeerId>,
|
||||
{
|
||||
type Handler = NodeHandlerWrapper<TIntoProtoHandler::Handler>;
|
||||
|
||||
fn into_handler(self, connected: &Connected<TConnInfo>) -> Self::Handler {
|
||||
fn into_handler(self, connected: &Connected) -> Self::Handler {
|
||||
NodeHandlerWrapper {
|
||||
handler: self.handler.into_handler(connected.peer_id(), &connected.endpoint),
|
||||
handler: self.handler.into_handler(&connected.peer_id, &connected.endpoint),
|
||||
negotiating_in: Default::default(),
|
||||
negotiating_out: Default::default(),
|
||||
queued_dial_upgrades: Vec::new(),
|
||||
|
Reference in New Issue
Block a user