Enum bitcoin_network::Network
source · #[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§
source§impl CheckIsReachable for Network
impl CheckIsReachable for Network
source§fn is_reachable(&self) -> bool
fn is_reachable(&self) -> bool
| @return | | true if the network is reachable, false | otherwise |
source§impl<'de> Deserialize<'de> for Network
impl<'de> Deserialize<'de> for Network
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq<Network> for Network
impl PartialEq<Network> for Network
impl Eq for Network
impl StructuralEq for Network
impl StructuralPartialEq for Network
Auto Trait Implementations§
impl RefUnwindSafe for Network
impl Send for Network
impl Sync for Network
impl Unpin for Network
impl UnwindSafe for Network
Blanket Implementations§
§impl<T, U> CastInto<U> for Twhere
U: CastFrom<T>,
impl<T, U> CastInto<U> for Twhere
U: CastFrom<T>,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.