Struct libp2p_ping::Ping
source · pub struct Ping<TSubstream> { /* private fields */ }
Expand description
Network behaviour that handles receiving pings sent by other nodes and periodically pings the nodes we are connected to.
See the crate root documentation for more information.
Implementations§
Trait Implementations§
source§impl<TSubstream, TTopology> NetworkBehaviour<TTopology> for Ping<TSubstream>where
TSubstream: AsyncRead + AsyncWrite,
impl<TSubstream, TTopology> NetworkBehaviour<TTopology> for Ping<TSubstream>where
TSubstream: AsyncRead + AsyncWrite,
§type ProtocolsHandler = ProtocolsHandlerSelect<PingListenHandler<TSubstream>, PeriodicPingHandler<TSubstream>>
type ProtocolsHandler = ProtocolsHandlerSelect<PingListenHandler<TSubstream>, PeriodicPingHandler<TSubstream>>
Handler for all the protocols the network supports.
source§fn new_handler(&mut self) -> Self::ProtocolsHandler
fn new_handler(&mut self) -> Self::ProtocolsHandler
Builds a new
ProtocolsHandler
.source§fn inject_connected(&mut self, _: PeerId, _: ConnectedPoint)
fn inject_connected(&mut self, _: PeerId, _: ConnectedPoint)
Indicates the behaviour that we connected to the node with the given peer id through the
given endpoint. Read more
source§fn inject_disconnected(&mut self, _: &PeerId, _: ConnectedPoint)
fn inject_disconnected(&mut self, _: &PeerId, _: ConnectedPoint)
Indicates the behaviour that we disconnected from the node with the given peer id. The
endpoint is the one we used to be connected to. Read more
source§fn inject_node_event(
&mut self,
source: PeerId,
event: <Self::ProtocolsHandler as ProtocolsHandler>::OutEvent
)
fn inject_node_event(
&mut self,
source: PeerId,
event: <Self::ProtocolsHandler as ProtocolsHandler>::OutEvent
)
Indicates the behaviour that the node with the given peer id has generated an event for
us. Read more
source§fn poll(
&mut self,
_: &mut PollParameters<'_, TTopology>
) -> Async<NetworkBehaviourAction<<Self::ProtocolsHandler as ProtocolsHandler>::InEvent, Self::OutEvent>>
fn poll(
&mut self,
_: &mut PollParameters<'_, TTopology>
) -> Async<NetworkBehaviourAction<<Self::ProtocolsHandler as ProtocolsHandler>::InEvent, Self::OutEvent>>
Polls for things that swarm should do. Read more