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.
Trait Implementations§
impl Copy for IpStack
impl Eq for IpStack
impl StructuralPartialEq for IpStack
Auto Trait Implementations§
impl Freeze for IpStack
impl RefUnwindSafe for IpStack
impl Send for IpStack
impl Sync for IpStack
impl Unpin for IpStack
impl UnsafeUnpin for IpStack
impl UnwindSafe for IpStack
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> 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§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.