Enum lightning::ln::msgs::SocketAddress   
source · pub enum SocketAddress {
    TcpIpV4 {
        addr: [u8; 4],
        port: u16,
    },
    TcpIpV6 {
        addr: [u8; 16],
        port: u16,
    },
    OnionV2([u8; 12]),
    OnionV3 {
        ed25519_pubkey: [u8; 32],
        checksum: u16,
        version: u8,
        port: u16,
    },
    Hostname {
        hostname: Hostname,
        port: u16,
    },
}Expand description
An address which can be used to connect to a remote peer.
Variants§
TcpIpV4
An IPv4 address and port on which the peer is listening.
TcpIpV6
An IPv6 address and port on which the peer is listening.
OnionV2([u8; 12])
An old-style Tor onion address/port on which the peer is listening.
This field is deprecated and the Tor network generally no longer supports V2 Onion addresses. Thus, the details are not parsed here.
OnionV3
A new-style Tor onion address/port on which the peer is listening.
To create the human-readable “hostname”, concatenate the ED25519 pubkey, checksum, and version, wrap as base32 and append “.onion”.
Fields
Hostname
A hostname/port on which the peer is listening.
Trait Implementations§
source§impl Clone for SocketAddress
 
impl Clone for SocketAddress
source§fn clone(&self) -> SocketAddress
 
fn clone(&self) -> SocketAddress
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moresource§impl Debug for SocketAddress
 
impl Debug for SocketAddress
source§impl Display for SocketAddress
 
impl Display for SocketAddress
source§impl From<SocketAddr> for SocketAddress
Available on crate feature std only. 
impl From<SocketAddr> for SocketAddress
Available on crate feature 
std only.source§fn from(addr: SocketAddr) -> Self
 
fn from(addr: SocketAddr) -> Self
Converts to this type from the input type.
source§impl From<SocketAddrV4> for SocketAddress
Available on crate feature std only. 
impl From<SocketAddrV4> for SocketAddress
Available on crate feature 
std only.source§fn from(addr: SocketAddrV4) -> Self
 
fn from(addr: SocketAddrV4) -> Self
Converts to this type from the input type.
source§impl From<SocketAddrV6> for SocketAddress
Available on crate feature std only. 
impl From<SocketAddrV6> for SocketAddress
Available on crate feature 
std only.source§fn from(addr: SocketAddrV6) -> Self
 
fn from(addr: SocketAddrV6) -> Self
Converts to this type from the input type.
source§impl FromStr for SocketAddress
Available on crate feature std only. 
impl FromStr for SocketAddress
Available on crate feature 
std only.source§impl Hash for SocketAddress
 
impl Hash for SocketAddress
source§impl PartialEq for SocketAddress
 
impl PartialEq for SocketAddress
source§fn eq(&self, other: &SocketAddress) -> bool
 
fn eq(&self, other: &SocketAddress) -> bool
This method tests for 
self and other values to be equal, and is used
by ==.source§impl Readable for SocketAddress
 
impl Readable for SocketAddress
source§fn read<R: Read>(reader: &mut R) -> Result<SocketAddress, DecodeError>
 
fn read<R: Read>(reader: &mut R) -> Result<SocketAddress, DecodeError>
Reads a 
Self in from the given Read.source§impl ToSocketAddrs for SocketAddress
Available on crate feature std only. 
impl ToSocketAddrs for SocketAddress
Available on crate feature 
std only.§type Iter = IntoIter<SocketAddr>
 
type Iter = IntoIter<SocketAddr>
Returned iterator over socket addresses which this type may correspond
to.
source§fn to_socket_addrs(&self) -> Result<Self::Iter>
 
fn to_socket_addrs(&self) -> Result<Self::Iter>
Converts this object to an iterator of resolved 
SocketAddrs. Read moresource§impl Writeable for SocketAddress
 
impl Writeable for SocketAddress
impl Eq for SocketAddress
impl StructuralPartialEq for SocketAddress
Auto Trait Implementations§
impl Freeze for SocketAddress
impl RefUnwindSafe for SocketAddress
impl Send for SocketAddress
impl Sync for SocketAddress
impl Unpin for SocketAddress
impl UnwindSafe for SocketAddress
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more