[][src]Struct iprs::peer_record::PeerRecord

pub struct PeerRecord { /* fields omitted */ }

PeerRecord contains information that is broadly useful to share with other peers, either through a direct exchange (as in the libp2p identify protocol), or through a Peer Routing provider, such as a DHT.

Currently, a PeerRecord contains the public listen addresses for a peer, but this is expected to expand to include other information in the future.

PeerRecords are ordered in time by their Seq field. Newer PeerRecords must have greater Seq values than older records.

Failing to set the Seq field will not result in an error, however, a PeerRecord with a Seq value of zero may be ignored or rejected by other peers.

PeerRecords are intended to be shared with other peers inside a signed Envelope.

Implementations

impl PeerRecord[src]

pub fn from_peer_id(
    peer_id: PeerId,
    addrs: Vec<Multiaddr>
) -> Result<PeerRecord>
[src]

pub fn decode_protobuf(data: &[u8]) -> Result<Self>[src]

pub fn encode_protobuf(self) -> Result<Vec<u8>>[src]

pub fn to_domain(&self) -> String[src]

pub fn to_multicodec(&self) -> Multicodec[src]

Trait Implementations

impl Clone for PeerRecord[src]

impl Eq for PeerRecord[src]

impl PartialEq<PeerRecord> for PeerRecord[src]

impl StructuralEq for PeerRecord[src]

impl StructuralPartialEq for PeerRecord[src]

impl TryFrom<AddrInfo> for PeerRecord[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<PeerRecord> for PeerRecord[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<PeerRecord> for PeerRecord[src]

type Error = Error

The type returned in the event of a conversion error.

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,