Struct bip_peer::PeerInfo
[−]
[src]
pub struct PeerInfo { /* fields omitted */ }
Information that uniquely identifies a peer.
Equality oprations DO NOT INCLUDE Extensions
as we define a
unique peer as (address, peer_id, hash)
, so equality will be
based on that tuple.
Methods
impl PeerInfo
[src]
fn new(
addr: SocketAddr,
pid: PeerId,
hash: InfoHash,
extensions: Extensions
) -> PeerInfo
[src]
addr: SocketAddr,
pid: PeerId,
hash: InfoHash,
extensions: Extensions
) -> PeerInfo
Create a new PeerInfo
object.
fn addr(&self) -> &SocketAddr
[src]
Retrieve the peer address.
fn peer_id(&self) -> &PeerId
[src]
Retrieve the peer id.
fn hash(&self) -> &InfoHash
[src]
Retrieve the peer info hash.
fn extensions(&self) -> &Extensions
[src]
Retrieve the extensions supported by this peer.
Trait Implementations
impl Eq for PeerInfo
[src]
impl Debug for PeerInfo
[src]
impl Copy for PeerInfo
[src]
impl Clone for PeerInfo
[src]
fn clone(&self) -> PeerInfo
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for PeerInfo
[src]
fn eq(&self, other: &PeerInfo) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.