[][src]Struct libp2p_core::topology::MemoryTopology

pub struct MemoryTopology { /* fields omitted */ }

Topology of the network stored in memory.

Methods

impl MemoryTopology
[src]

pub fn empty(pubkey: PublicKey) -> MemoryTopology
[src]

Creates an empty topology.

pub fn is_empty(&self) -> bool
[src]

Returns true if the topology is empty.

pub fn add_address(&mut self, peer: PeerId, addr: Multiaddr)
[src]

Adds an address to the topology.

pub fn peers(
    &self
) -> impl Iterator<Item = &PeerId>
[src]

Returns a list of all the known peers in the topology.

pub fn iter(
    &self
) -> impl Iterator<Item = (&PeerId, &Multiaddr)>
[src]

Returns an iterator to all the entries in the topology.

Trait Implementations

impl Topology for MemoryTopology
[src]

fn set_connected(&mut self, _peer_id: &PeerId, _addr: &ConnectedPoint)
[src]

Indicates to the topology that we have successfully connected to the given address with the given PeerId. Read more

fn set_disconnected(
    &mut self,
    _peer_id: &PeerId,
    _addr: &ConnectedPoint,
    _reason: DisconnectReason
)
[src]

Indicates to the topology that we have been disconnected from the given address with the given PeerId. Read more

fn set_unreachable(&mut self, _addr: &Multiaddr)
[src]

Indicates to the topology that we have failed to reach the given address.

Auto Trait Implementations

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self

impl<T> Erased for T