Enum lightning::ln::msgs::NetAddress[][src]

pub enum NetAddress {
    IPv4 {
        addr: [u8; 4],
        port: u16,
    },
    IPv6 {
        addr: [u8; 16],
        port: u16,
    },
    OnionV2 {
        addr: [u8; 10],
        port: u16,
    },
    OnionV3 {
        ed25519_pubkey: [u8; 32],
        checksum: u16,
        version: u8,
        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.

Show fields

Fields of IPv4

addr: [u8; 4]

The 4-byte IPv4 address

port: u16

The port on which the node is listening

IPv6

An IPv6 address/port on which the peer is listening.

Show fields

Fields of IPv6

addr: [u8; 16]

The 16-byte IPv6 address

port: u16

The port on which the node is listening

OnionV2

An old-style Tor onion address/port on which the peer is listening.

Show fields

Fields of OnionV2

addr: [u8; 10]

The bytes (usually encoded in base32 with “.onion” appended)

port: u16

The port on which the node is listening

OnionV3

A new-style Tor onion address/port on which the peer is listening. To create the human-readable “hostname”, concatenate ed25519_pubkey, checksum, and version, wrap as base32 and append “.onion”.

Show fields

Fields of OnionV3

ed25519_pubkey: [u8; 32]

The ed25519 long-term public key of the peer

checksum: u16

The checksum of the pubkey and version, as included in the onion address

version: u8

The version byte, as defined by the Tor Onion v3 spec.

port: u16

The port on which the node is listening

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Reads a Self in from the given Read

Writes self out to the given Writer

Writes self out to a Vec

Writes self out to a Vec

Gets the length of this object after it has been serialized. This can be overridden to optimize cases where we prepend an object with its length. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.