Enum lightning::ln::msgs::NetAddress
source · pub enum NetAddress {
IPv4 {
addr: [u8; 4],
port: u16,
},
IPv6 {
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§
IPv4
An IPv4 address/port on which the peer is listening.
IPv6
An IPv6 address/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
Fields
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”.
Hostname
Fields
A hostname/port on which the peer is listening.
Trait Implementations§
source§impl Clone for NetAddress
impl Clone for NetAddress
source§fn clone(&self) -> NetAddress
fn clone(&self) -> NetAddress
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 NetAddress
impl Debug for NetAddress
source§impl PartialEq<NetAddress> for NetAddress
impl PartialEq<NetAddress> for NetAddress
source§fn eq(&self, other: &NetAddress) -> bool
fn eq(&self, other: &NetAddress) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Readable for NetAddress
impl Readable for NetAddress
source§fn read<R: Read>(reader: &mut R) -> Result<NetAddress, DecodeError>
fn read<R: Read>(reader: &mut R) -> Result<NetAddress, DecodeError>
Reads a
Self
in from the given Read
.