|
21 | 21 | use super::{DialError, DialingOpts, Network}; |
22 | 22 | use crate::{ |
23 | 23 | connection::{ |
24 | | - handler::THandlerInEvent, pool::Pool, Connected, ConnectedPoint, Connection, |
25 | | - ConnectionHandler, ConnectionId, ConnectionLimit, EstablishedConnection, |
26 | | - EstablishedConnectionIter, IntoConnectionHandler, PendingConnection, Substream, |
| 24 | + handler::THandlerInEvent, pool::Pool, ConnectedPoint, ConnectionHandler, ConnectionId, |
| 25 | + ConnectionLimit, EstablishedConnection, EstablishedConnectionIter, IntoConnectionHandler, |
| 26 | + PendingConnection, Substream, |
27 | 27 | }, |
28 | 28 | Multiaddr, PeerId, StreamMuxer, Transport, |
29 | 29 | }; |
@@ -472,44 +472,6 @@ where |
472 | 472 | pub fn into_peer(self) -> Peer<'a, TTrans, THandler> { |
473 | 473 | Peer::Disconnected(self) |
474 | 474 | } |
475 | | - |
476 | | - /// Moves the peer into a connected state by supplying an existing |
477 | | - /// established connection. |
478 | | - /// |
479 | | - /// No event is generated for this action. |
480 | | - /// |
481 | | - /// # Panics |
482 | | - /// |
483 | | - /// Panics if `connected.peer_id` does not identify the current peer. |
484 | | - pub fn set_connected<TMuxer>( |
485 | | - self, |
486 | | - connected: Connected, |
487 | | - connection: Connection<TMuxer, THandler::Handler>, |
488 | | - ) -> Result<ConnectedPeer<'a, TTrans, THandler>, ConnectionLimit> |
489 | | - where |
490 | | - THandler: Send + 'static, |
491 | | - TTrans::Error: Send + 'static, |
492 | | - THandler::Handler: ConnectionHandler<Substream = Substream<TMuxer>> + Send, |
493 | | - <THandler::Handler as ConnectionHandler>::OutboundOpenInfo: Send, |
494 | | - <THandler::Handler as ConnectionHandler>::Error: error::Error + Send + 'static, |
495 | | - TMuxer: StreamMuxer + Send + Sync + 'static, |
496 | | - TMuxer::OutboundSubstream: Send, |
497 | | - { |
498 | | - if connected.peer_id != self.peer_id { |
499 | | - panic!( |
500 | | - "Invalid peer ID given: {:?}. Expected: {:?}", |
501 | | - connected.peer_id, self.peer_id |
502 | | - ) |
503 | | - } |
504 | | - |
505 | | - self.network |
506 | | - .pool |
507 | | - .add(connection, connected) |
508 | | - .map(move |_id| ConnectedPeer { |
509 | | - network: self.network, |
510 | | - peer_id: self.peer_id, |
511 | | - }) |
512 | | - } |
513 | 475 | } |
514 | 476 |
|
515 | 477 | /// The (internal) state of a `DialingAttempt`, tracking the |
|
0 commit comments