Struct libp2p_identify::Identify
source · pub struct Identify<TSubstream> { /* private fields */ }
Expand description
Network behaviour that automatically identifies nodes periodically, returns information about them, and answers identify queries from other nodes.
Implementations
Trait Implementations
sourceimpl<TSubstream, TTopology> NetworkBehaviour<TTopology> for Identify<TSubstream>where
TSubstream: AsyncRead + AsyncWrite,
TTopology: IdentifyTopology,
impl<TSubstream, TTopology> NetworkBehaviour<TTopology> for Identify<TSubstream>where
TSubstream: AsyncRead + AsyncWrite,
TTopology: IdentifyTopology,
type ProtocolsHandler = ProtocolsHandlerSelect<IdentifyListenHandler<TSubstream>, PeriodicIdHandler<TSubstream>>
type ProtocolsHandler = ProtocolsHandlerSelect<IdentifyListenHandler<TSubstream>, PeriodicIdHandler<TSubstream>>
Handler for all the protocols the network supports.
type OutEvent = IdentifyEvent
type OutEvent = IdentifyEvent
Event generated by the swarm.
sourcefn new_handler(&mut self) -> Self::ProtocolsHandler
fn new_handler(&mut self) -> Self::ProtocolsHandler
Builds a new
ProtocolsHandler
.sourcefn inject_connected(&mut self, peer_id: PeerId, endpoint: ConnectedPoint)
fn inject_connected(&mut self, peer_id: PeerId, endpoint: ConnectedPoint)
Indicates the behaviour that we connected to the node with the given peer id through the
given endpoint. Read more
sourcefn inject_disconnected(&mut self, peer_id: &PeerId, _: ConnectedPoint)
fn inject_disconnected(&mut self, peer_id: &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
sourcefn inject_node_event(
&mut self,
peer_id: PeerId,
event: <Self::ProtocolsHandler as ProtocolsHandler>::OutEvent
)
fn inject_node_event(
&mut self,
peer_id: 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
sourcefn poll(
&mut self,
params: &mut PollParameters<'_, TTopology>
) -> Async<NetworkBehaviourAction<<Self::ProtocolsHandler as ProtocolsHandler>::InEvent, Self::OutEvent>>
fn poll(
&mut self,
params: &mut PollParameters<'_, TTopology>
) -> Async<NetworkBehaviourAction<<Self::ProtocolsHandler as ProtocolsHandler>::InEvent, Self::OutEvent>>
Polls for things that swarm should do. Read more
Auto Trait Implementations
impl<TSubstream> !RefUnwindSafe for Identify<TSubstream>
impl<TSubstream> Send for Identify<TSubstream>where
TSubstream: Send,
impl<TSubstream> Sync for Identify<TSubstream>where
TSubstream: Sync,
impl<TSubstream> Unpin for Identify<TSubstream>where
TSubstream: Unpin,
impl<TSubstream> !UnwindSafe for Identify<TSubstream>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more