Struct libp2p_core::swarm::PollParameters
source · pub struct PollParameters<'a, TTopology: 'a> { /* private fields */ }Expand description
Parameters passed to poll() that the NetworkBehaviour has access to.
Implementations
sourceimpl<'a, TTopology> PollParameters<'a, TTopology>
impl<'a, TTopology> PollParameters<'a, TTopology>
sourcepub fn topology(&mut self) -> &mut TTopology
pub fn topology(&mut self) -> &mut TTopology
Returns a reference to the topology of the network.
sourcepub fn supported_protocols(&self) -> impl ExactSizeIterator<Item = &[u8]>
pub fn supported_protocols(&self) -> impl ExactSizeIterator<Item = &[u8]>
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.
sourcepub fn listened_addresses(&self) -> impl ExactSizeIterator<Item = &Multiaddr>
pub fn listened_addresses(&self) -> impl ExactSizeIterator<Item = &Multiaddr>
Returns the list of the addresses we’re listening on.
sourcepub fn external_addresses<'b>(
&'b mut self
) -> impl ExactSizeIterator<Item = Multiaddr> + 'bwhere
TTopology: Topology,
pub fn external_addresses<'b>(
&'b mut self
) -> impl ExactSizeIterator<Item = Multiaddr> + 'bwhere
TTopology: Topology,
Returns the list of the addresses nodes can use to reach us.
sourcepub fn local_public_key(&self) -> &PublicKeywhere
TTopology: Topology,
pub fn local_public_key(&self) -> &PublicKeywhere
TTopology: Topology,
Returns the public key of the local node.
sourcepub fn local_peer_id(&self) -> &PeerIdwhere
TTopology: Topology,
pub fn local_peer_id(&self) -> &PeerIdwhere
TTopology: Topology,
Returns the peer id of the local node.
Auto Trait Implementations
impl<'a, TTopology> !RefUnwindSafe for PollParameters<'a, TTopology>
impl<'a, TTopology> !Send for PollParameters<'a, TTopology>
impl<'a, TTopology> !Sync for PollParameters<'a, TTopology>
impl<'a, TTopology> Unpin for PollParameters<'a, TTopology>
impl<'a, TTopology> !UnwindSafe for PollParameters<'a, TTopology>
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