Struct p2p::PeerInfo [−][src]
pub struct PeerInfo { pub addr: SocketAddr, pub pub_key: PublicKey, }
Information necessary to connect to peer.
Fields
addr: SocketAddr
Peer IP address.
pub_key: PublicKey
Peer public key.
Methods
impl PeerInfo
[src]
impl PeerInfo
pub fn new(addr: SocketAddr, pub_key: PublicKey) -> Self
[src]
pub fn new(addr: SocketAddr, pub_key: PublicKey) -> Self
Constructs peer info.
pub fn with_rand_key(addr: SocketAddr) -> Self
[src]
pub fn with_rand_key(addr: SocketAddr) -> Self
Constructs peer info with random generated public key.
Trait Implementations
impl PartialEq for PeerInfo
[src]
impl PartialEq for PeerInfo
fn eq(&self, other: &PeerInfo) -> bool
[src]
fn eq(&self, other: &PeerInfo) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &PeerInfo) -> bool
[src]
fn ne(&self, other: &PeerInfo) -> bool
This method tests for !=
.
impl Eq for PeerInfo
[src]
impl Eq for PeerInfo
impl Hash for PeerInfo
[src]
impl Hash for PeerInfo
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
[src]Feeds a slice of this type into the given [Hasher
]. Read more
impl Clone for PeerInfo
[src]
impl Clone for PeerInfo
fn clone(&self) -> PeerInfo
[src]
fn clone(&self) -> PeerInfo
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Debug for PeerInfo
[src]
impl Debug for PeerInfo
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Display for PeerInfo
[src]
impl Display for PeerInfo