Struct libp2p::mdns::service::MdnsPeer [−][src]
pub struct MdnsPeer { /* fields omitted */ }A peer discovered by the service.
Implementations
impl MdnsPeer[src]
impl MdnsPeer[src]pub fn new(
packet: &Packet<'_>,
record_value: String,
my_peer_id: PeerId,
ttl: u32
) -> MdnsPeer[src]
packet: &Packet<'_>,
record_value: String,
my_peer_id: PeerId,
ttl: u32
) -> MdnsPeer
Creates a new MdnsPeer based on the provided Packet.
pub fn id(&self) -> &PeerId[src]
Returns the id of the peer.
pub fn ttl(&self) -> Duration[src]
Returns the requested time-to-live for the record.
pub fn addresses(&self) -> &Vec<Multiaddr, Global>[src]
Returns the list of addresses the peer says it is listening on.
Filters out invalid addresses.