Struct libp2p_mdns::Mdns[][src]

pub struct Mdns { /* fields omitted */ }

A NetworkBehaviour for mDNS. Automatically discovers peers on the local network and adds them to the topology.

Implementations

impl Mdns[src]

pub async fn new() -> Result<Self>[src]

Builds a new Mdns behaviour.

pub fn has_node(&self, peer_id: &PeerId) -> bool[src]

Returns true if the given PeerId is in the list of nodes discovered through mDNS.

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

Returns the list of nodes that we have discovered through mDNS and that are not expired.

Trait Implementations

impl Debug for Mdns[src]

impl NetworkBehaviour for Mdns[src]

type ProtocolsHandler = DummyProtocolsHandler

Handler for all the protocols the network behaviour supports.

type OutEvent = MdnsEvent

Event generated by the NetworkBehaviour and that the swarm will report back.

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,