pub enum IpStack {
None,
V4Only,
V6Only,
DualStack,
}Expand description
The IP-stack capability currently available to the host.
This reflects which IP protocol versions the host has usable addresses /
routes for, as reported by the underlying netwatch interface state
(have_v4 / have_v6). The semantics are identical across platforms: it
describes local stack availability, not per-protocol Internet reachability.
Variants§
None
Neither IPv4 nor IPv6 is available.
V4Only
Only IPv4 is available.
V6Only
Only IPv6 is available.
DualStack
Both IPv4 and IPv6 are available.
Implementations§
Source§impl IpStack
impl IpStack
Sourcepub const fn name(&self) -> &'static str
pub const fn name(&self) -> &'static str
The variant name as a static string (e.g. "DualStack").
Used both by the fmt::Display implementation and as a stable,
human-readable label when forwarding the value to logging.
Sourcepub const fn has_ipv4(&self) -> bool
pub const fn has_ipv4(&self) -> bool
Whether IPv4 is available (true for IpStack::V4Only and
IpStack::DualStack).
Sourcepub const fn has_ipv6(&self) -> bool
pub const fn has_ipv6(&self) -> bool
Whether IPv6 is available (true for IpStack::V6Only and
IpStack::DualStack).
Sourcepub const fn is_dual_stack(&self) -> bool
pub const fn is_dual_stack(&self) -> bool
Whether both IPv4 and IPv6 are available.