[−][src]Struct iprs::peer_record::PeerRecord
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]
peer_id: PeerId,
addrs: Vec<Multiaddr>
) -> Result<PeerRecord>
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]
fn clone(&self) -> PeerRecord
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Eq for PeerRecord
[src]
impl PartialEq<PeerRecord> for PeerRecord
[src]
fn eq(&self, other: &PeerRecord) -> bool
[src]
fn ne(&self, other: &PeerRecord) -> bool
[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.
fn try_from(val: AddrInfo) -> Result<Self>
[src]
impl TryFrom<PeerRecord> for PeerRecord
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(val: PeerRecord) -> Result<Self>
[src]
impl TryFrom<PeerRecord> for PeerRecord
[src]
Auto Trait Implementations
impl RefUnwindSafe for PeerRecord
impl Send for PeerRecord
impl Sync for PeerRecord
impl Unpin for PeerRecord
impl UnwindSafe for PeerRecord
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,