async fn handle_swarm_event(&mut self, event: SwarmEvent<PyrsiaNetworkEvent, impl Error>) {
        trace!("Handle SwarmEvent: {:?}", event);
        match event {
            SwarmEvent::Behaviour(_) => {
                debug!("Unmatched Behaviour swarm event found: {:?}", event);
            }
            SwarmEvent::NewListenAddr { address, .. } => {
                let local_peer_id = *self.swarm.local_peer_id();
                info!(
                    "Local node is listening on {:?}",
                    address.with(Protocol::P2p(local_peer_id.into()))
                );
            }
            SwarmEvent::ConnectionEstablished {
                peer_id, endpoint, ..
            } => {
                if endpoint.is_dialer() {
                    if let Some(sender) = self.pending_dial.remove(&peer_id) {
                        let _ = sender.send(Ok(()));
                    }
                }
            }
            SwarmEvent::ConnectionClosed { .. } => {}
            SwarmEvent::OutgoingConnectionError { peer_id, error, .. } => {
                if let Some(peer_id) = peer_id {
                    if let Some(sender) = self.pending_dial.remove(&peer_id) {
                        let _ = sender.send(Err(error.into()));
                    }
                }
            }
            SwarmEvent::BannedPeer { .. } => {}
            SwarmEvent::Dialing(peer_id) => {
                debug!(
                    "Local Peer {} is dialing Peer {}...",
                    self.swarm.local_peer_id(),
                    peer_id
                );
            }
            SwarmEvent::ExpiredListenAddr { .. } => {}
            SwarmEvent::IncomingConnection { .. } => {}
            SwarmEvent::IncomingConnectionError { .. } => {}
            SwarmEvent::ListenerClosed { .. } => {}
            SwarmEvent::ListenerError { .. } => {}
        }
    }
// Handles all other events from the libp2p `Swarm`.
Handles all other events from the libp2p `Swarm`.
Handles all other events from the libp2p ` Swarm ` .
async fn handle_swarm_event(&mut self, event: SwarmEvent<PyrsiaNetworkEvent, impl Error>) {
        trace!("Handle SwarmEvent: {:?}", event);
        match event {
            SwarmEvent::Behaviour(_) => {
                debug!("Unmatched Behaviour swarm event found: {:?}", event);
            }
            SwarmEvent::NewListenAddr { address, .. } => {
                let local_peer_id = *self.swarm.local_peer_id();
                info!(
                    "Local node is listening on {:?}",
                    address.with(Protocol::P2p(local_peer_id.into()))
                );
            }
            SwarmEvent::ConnectionEstablished {
                peer_id, endpoint, ..
            } => {
                if endpoint.is_dialer() {
                    if let Some(sender) = self.pending_dial.remove(&peer_id) {
                        let _ = sender.send(Ok(()));
                    }
                }
            }
            SwarmEvent::ConnectionClosed { .. } => {}
            SwarmEvent::OutgoingConnectionError { peer_id, error, .. } => {
                if let Some(peer_id) = peer_id {
                    if let Some(sender) = self.pending_dial.remove(&peer_id) {
                        let _ = sender.send(Err(error.into()));
                    }
                }
            }
            SwarmEvent::BannedPeer { .. } => {}
            SwarmEvent::Dialing(peer_id) => {
                debug!(
                    "Local Peer {} is dialing Peer {}...",
                    self.swarm.local_peer_id(),
                    peer_id
                );
            }
            SwarmEvent::ExpiredListenAddr { .. } => {}
            SwarmEvent::IncomingConnection { .. } => {}
            SwarmEvent::IncomingConnectionError { .. } => {}
            SwarmEvent::ListenerClosed { .. } => {}
            SwarmEvent::ListenerError { .. } => {}
        }
    }
async fn handle_swarm_event ( & mut self , event : SwarmEvent < PyrsiaNetworkEvent , impl Error > ) { trace ! ( " " event ) ; match event { SwarmEvent :: Behaviour ( _ ) => { debug ! ( " " event ) ; } SwarmEvent :: NewListenAddr { address , .. } => { let local_peer_id = * self . swarm . local_peer_id ( ) ; info ! ( " " address with ( Protocol P2p ( local_peer_id into ( ) ) ) ) ; } SwarmEvent :: ConnectionEstablished { peer_id , endpoint , .. } => { if endpoint . is_dialer ( ) { if let Some ( sender ) = self . pending_dial . remove ( & peer_id ) { let _ = sender . send ( Ok ( ( ) ) ) ; } } } SwarmEvent :: ConnectionClosed { .. } => { } SwarmEvent :: OutgoingConnectionError { peer_id , error , .. } => { if let Some ( peer_id ) = peer_id { if let Some ( sender ) = self . pending_dial . remove ( & peer_id ) { let _ = sender . send ( Err ( error . into ( ) ) ) ; } } } SwarmEvent :: BannedPeer { .. } => { } SwarmEvent :: Dialing ( peer_id ) => { debug ! ( " " self swarm local_peer_id ( ) peer_id ) ; } SwarmEvent :: ExpiredListenAddr { .. } => { } SwarmEvent :: IncomingConnection { .. } => { } SwarmEvent :: IncomingConnectionError { .. } => { } SwarmEvent :: ListenerClosed { .. } => { } SwarmEvent :: ListenerError { .. } => { } } }
Handles all other events from the libp2p `Swarm`.
Handles all other events from the libp2p ` Swarm ` .
&mut self
event
SwarmEvent<PyrsiaNetworkEvent, impl Error>
&mut self
event
SwarmEvent<PyrsiaNetworkEvent, impl Error>