[][src]Struct grin_p2p::types::PeerAddr

pub struct PeerAddr(pub SocketAddr);

Implementations

impl PeerAddr[src]

pub fn from_ip(addr: IpAddr) -> PeerAddr[src]

Convenient way of constructing a new peer_addr from an ip_addr defaults to port 3414 on mainnet and 13414 on floonet.

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

If the ip is loopback then our key is "ip:port" (mainly for local usernet testing). Otherwise we only care about the ip (we disallow multiple peers on the same ip address).

Trait Implementations

impl Clone for PeerAddr[src]

impl Copy for PeerAddr[src]

impl Debug for PeerAddr[src]

impl<'de> Deserialize<'de> for PeerAddr[src]

impl Display for PeerAddr[src]

impl Eq for PeerAddr[src]

impl Hash for PeerAddr[src]

fn hash<H: Hasher>(&self, state: &mut H)[src]

If loopback address then we care about ip and port. If regular address then we only care about the ip and ignore the port.

impl PartialEq<PeerAddr> for PeerAddr[src]

fn eq(&self, other: &PeerAddr) -> bool[src]

If loopback address then we care about ip and port. If regular address then we only care about the ip and ignore the port.

impl Readable for PeerAddr[src]

impl Serialize for PeerAddr[src]

impl Writeable for PeerAddr[src]

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> CloneAny for T where
    T: Clone + Any

impl<T> DebugAny for T where
    T: Any + Debug

impl<'a, T> DefaultFeatures<'a> for T where
    T: 'a + Clone + Send + Sync

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<'a, T> NonSyncFeatures<'a> for T where
    T: 'a + Clone

impl<T> SafeBorrow<T> for T where
    T: ?Sized

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> ToString for T where
    T: Display + ?Sized
[src]

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<T> UnsafeAny for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,