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

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

Implementations

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 Clone for Address[src]

impl Debug for Address[src]

impl Decodable for Address[src]

impl Encodable for Address[src]

impl Eq for Address[src]

impl Hash for Address[src]

impl PartialEq<Address> for Address[src]

impl StructuralEq for Address[src]

impl StructuralPartialEq for Address[src]

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 RefUnwindSafe for Address

impl Send for Address

impl Sync for Address

impl Unpin for Address

impl UnwindSafe for Address

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> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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.