#[repr(u8)]pub enum Network {
NET_UNROUTABLE = 0,
NET_IPV4 = 1,
NET_IPV6 = 2,
NET_ONION = 3,
NET_I2P = 4,
NET_CJDNS = 5,
NET_INTERNAL = 6,
NET_MAX = 7,
}
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 = 0
| Addresses from these networks are not | publicly routable on the global Internet. |
NET_IPV4 = 1
| IPv4 |
NET_IPV6 = 2
| IPv6 |
NET_ONION = 3
| TOR (v2 or v3) |
NET_I2P = 4
| I2P |
NET_CJDNS = 5
| CJDNS |
NET_INTERNAL = 6
| 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 = 7
| 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>,
impl Eq for Network
impl StructuralPartialEq for Network
Auto Trait Implementations§
impl Freeze for Network
impl RefUnwindSafe for Network
impl Send for Network
impl Sync for Network
impl Unpin for Network
impl UnwindSafe for Network
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
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.