Trait libp2p_swarm::behaviour::PollParameters
source · pub trait PollParameters {
type SupportedProtocolsIter: ExactSizeIterator<Item = Vec<u8>>;
type ListenedAddressesIter: ExactSizeIterator<Item = Multiaddr>;
type ExternalAddressesIter: ExactSizeIterator<Item = AddressRecord>;
// Required methods
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.
Required Associated Types§
sourcetype SupportedProtocolsIter: ExactSizeIterator<Item = Vec<u8>>
type SupportedProtocolsIter: ExactSizeIterator<Item = Vec<u8>>
Iterator returned by supported_protocols
.
sourcetype ListenedAddressesIter: ExactSizeIterator<Item = Multiaddr>
type ListenedAddressesIter: ExactSizeIterator<Item = Multiaddr>
Iterator returned by listened_addresses
.
sourcetype ExternalAddressesIter: ExactSizeIterator<Item = AddressRecord>
type ExternalAddressesIter: ExactSizeIterator<Item = AddressRecord>
Iterator returned by external_addresses
.
Required Methods§
sourcefn 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.
sourcefn listened_addresses(&self) -> Self::ListenedAddressesIter
fn listened_addresses(&self) -> Self::ListenedAddressesIter
👎Deprecated since 0.42.0: Use
libp2p_swarm::ListenAddresses
instead.Returns the list of the addresses we’re listening on.
sourcefn external_addresses(&self) -> Self::ExternalAddressesIter
fn external_addresses(&self) -> Self::ExternalAddressesIter
👎Deprecated since 0.42.0: Use
libp2p_swarm::ExternalAddresses
instead.Returns the list of the addresses nodes can use to reach us.
sourcefn local_peer_id(&self) -> &PeerId
fn local_peer_id(&self) -> &PeerId
👎Deprecated since 0.42.0: Pass the node’s
PeerId
into the behaviour instead.Returns the peer id of the local node.