[][src]Struct bitcoin::network::address::Address

pub struct Address {
    pub services: ServiceFlags,
    pub address: [u16; 8],
    pub port: u16,
}

A message which can be sent on the Bitcoin network

Fields

services: ServiceFlags

Services provided by the peer whose address this is

address: [u16; 8]

Network byte-order ipv6 address, or ipv4-mapped ipv6 address

port: u16

Network port

Methods

impl Address[src]

pub fn new(socket: &SocketAddr, services: ServiceFlags) -> Address[src]

Create an address message for a socket

pub fn socket_addr(&self) -> Result<SocketAddr, Error>[src]

Extract socket address from an [Address] message. This will return [io::Error] [ErrorKind::AddrNotAvailable] if the message contains a Tor address.

Trait Implementations

impl Encodable for Address[src]

impl Decodable for Address[src]

impl Clone for Address[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<Address> for Address[src]

impl Eq for Address[src]

impl Debug for Address[src]

impl Hash for Address[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 ToSocketAddrs for Address[src]

type Iter = Once<SocketAddr>

Returned iterator over socket addresses which this type may correspond to. Read more

Auto Trait Implementations

impl Unpin for Address

impl Sync for Address

impl Send for Address

impl UnwindSafe for Address

impl RefUnwindSafe for Address

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[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> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]