Trait libp2p::swarm::PollParameters
source · [−]pub trait PollParameters {
type SupportedProtocolsIter: ExactSizeIterator
where
<Self::SupportedProtocolsIter as Iterator>::Item == Vec<u8, Global>;
type ListenedAddressesIter: ExactSizeIterator
where
<Self::ListenedAddressesIter as Iterator>::Item == Multiaddr;
type ExternalAddressesIter: ExactSizeIterator
where
<Self::ExternalAddressesIter as Iterator>::Item == AddressRecord;
fn supported_protocols(&self) -> Self::SupportedProtocolsIter;
fn listened_addresses(&self) -> Self::ListenedAddressesIter;
fn external_addresses(&self) -> Self::ExternalAddressesIter;
fn local_peer_id(&self) -> &PeerId;
}
Expand description
Parameters passed to poll()
, that the NetworkBehaviour
has access to.
Associated Types
type SupportedProtocolsIter: ExactSizeIterator
where
<Self::SupportedProtocolsIter as Iterator>::Item == Vec<u8, Global>
type SupportedProtocolsIter: ExactSizeIterator
where
<Self::SupportedProtocolsIter as Iterator>::Item == Vec<u8, Global>
Iterator returned by supported_protocols
.
type ListenedAddressesIter: ExactSizeIterator
where
<Self::ListenedAddressesIter as Iterator>::Item == Multiaddr
type ListenedAddressesIter: ExactSizeIterator
where
<Self::ListenedAddressesIter as Iterator>::Item == Multiaddr
Iterator returned by listened_addresses
.
type ExternalAddressesIter: ExactSizeIterator
where
<Self::ExternalAddressesIter as Iterator>::Item == AddressRecord
type ExternalAddressesIter: ExactSizeIterator
where
<Self::ExternalAddressesIter as Iterator>::Item == AddressRecord
Iterator returned by external_addresses
.
Required methods
fn supported_protocols(&self) -> Self::SupportedProtocolsIter
fn supported_protocols(&self) -> Self::SupportedProtocolsIter
Returns the list of protocol the behaviour supports when a remote negotiates a protocol on an inbound substream.
The iterator’s elements are the ASCII names as reported on the wire.
Note that the list is computed once at initialization and never refreshed.
fn listened_addresses(&self) -> Self::ListenedAddressesIter
fn listened_addresses(&self) -> Self::ListenedAddressesIter
Returns the list of the addresses we’re listening on.
fn external_addresses(&self) -> Self::ExternalAddressesIter
fn external_addresses(&self) -> Self::ExternalAddressesIter
Returns the list of the addresses nodes can use to reach us.
fn local_peer_id(&self) -> &PeerId
fn local_peer_id(&self) -> &PeerId
Returns the peer id of the local node.