#[repr(u8)]
pub enum Network {
    NET_UNROUTABLE,
    NET_IPV4,
    NET_IPV6,
    NET_ONION,
    NET_I2P,
    NET_CJDNS,
    NET_INTERNAL,
    NET_MAX,
}
Expand description

| A network type. | | ———– | @note | | An address may belong to more than one | network, for example 10.0.0.1 belongs | to both NET_UNROUTABLE and NET_IPV4. | | Keep these sequential starting from | 0 and NET_MAX as the last entry. | | We have loops like for (int i = 0; i < NET_MAX; | ++i) that expect to iterate over all | enum values and also GetExtNetwork() | “extends” this enum by introducing | standalone constants starting from | NET_MAX. |

Variants§

§

NET_UNROUTABLE

| Addresses from these networks are not | publicly routable on the global Internet. |

§

NET_IPV4

| IPv4 |

§

NET_IPV6

| IPv6 |

§

NET_ONION

| TOR (v2 or v3) |

§

NET_I2P

| I2P |

§

NET_CJDNS

| CJDNS |

§

NET_INTERNAL

| A set of addresses that represent the hash | of a string or FQDN. We use them in | AddrMan to keep track of which DNS seeds | were used.

§

NET_MAX

| Dummy value to indicate the number of | NET_* constants. |

Trait Implementations§

| @return | | true if the network is reachable, false | otherwise |

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Serialize this value into the given Serde serializer. 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. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Convert type of a const pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.