[][src]Trait libp2prs_swarm::protocol_handler::Notifiee

pub trait Notifiee {
    pub fn connected(&mut self, _conn: &mut Connection) { ... }
pub fn disconnected(&mut self, _conn: &mut Connection) { ... }
pub fn identified(&mut self, _peer: PeerId) { ... }
pub fn address_changed(&mut self, _addrs: Vec<Multiaddr>) { ... } }

Notifiee is an trait for an object wishing to receive notifications from swarm.

Provided methods

pub fn connected(&mut self, _conn: &mut Connection)[src]

It is emitted when a connection is connected.

pub fn disconnected(&mut self, _conn: &mut Connection)[src]

It is emitted when a connection is disconnected.

pub fn identified(&mut self, _peer: PeerId)[src]

It is emitted when finishing identified a remote peer. Therefore, the multiaddr and protocols of the remote peer can be retrieved from the PeerStore.

pub fn address_changed(&mut self, _addrs: Vec<Multiaddr>)[src]

It is emitted when the listen addresses for the local host changes. This might happen for some reasons, f.g., interface up/down.

The notification contains a snapshot of the current listen addresses.

Loading content...

Implementors

impl Notifiee for DummyProtocolHandler[src]

Loading content...