pub struct AdapterSnapshot {
pub name: String,
pub kind: AdapterKind,
pub ipv4_addresses: Vec<Ipv4Addr>,
pub ipv6_addresses: Vec<Ipv6Addr>,
}Expand description
A snapshot of a single network adapter’s addresses at a point in time.
§Equality
Two snapshots are equal if they have the same name, kind, and addresses. Address order matters for equality comparison.
Fields§
§name: StringThe friendly name of the adapter (e.g., “Ethernet”, “Wi-Fi”).
kind: AdapterKindThe type of adapter.
ipv4_addresses: Vec<Ipv4Addr>All IPv4 addresses assigned to this adapter.
ipv6_addresses: Vec<Ipv6Addr>All IPv6 addresses assigned to this adapter.
Implementations§
Source§impl AdapterSnapshot
impl AdapterSnapshot
Sourcepub fn new(
name: impl Into<String>,
kind: AdapterKind,
ipv4_addresses: Vec<Ipv4Addr>,
ipv6_addresses: Vec<Ipv6Addr>,
) -> Self
pub fn new( name: impl Into<String>, kind: AdapterKind, ipv4_addresses: Vec<Ipv4Addr>, ipv6_addresses: Vec<Ipv6Addr>, ) -> Self
Creates a new adapter snapshot.
Sourcepub fn has_addresses(&self) -> bool
pub fn has_addresses(&self) -> bool
Returns true if this adapter has any addresses (IPv4 or IPv6).
Sourcepub fn address_count(&self) -> usize
pub fn address_count(&self) -> usize
Returns the total number of addresses (IPv4 + IPv6).
Trait Implementations§
Source§impl Clone for AdapterSnapshot
impl Clone for AdapterSnapshot
Source§fn clone(&self) -> AdapterSnapshot
fn clone(&self) -> AdapterSnapshot
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AdapterSnapshot
impl Debug for AdapterSnapshot
Source§impl<'de> Deserialize<'de> for AdapterSnapshot
impl<'de> Deserialize<'de> for AdapterSnapshot
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AdapterSnapshot
impl PartialEq for AdapterSnapshot
Source§impl Serialize for AdapterSnapshot
impl Serialize for AdapterSnapshot
impl Eq for AdapterSnapshot
impl StructuralPartialEq for AdapterSnapshot
Auto Trait Implementations§
impl Freeze for AdapterSnapshot
impl RefUnwindSafe for AdapterSnapshot
impl Send for AdapterSnapshot
impl Sync for AdapterSnapshot
impl Unpin for AdapterSnapshot
impl UnwindSafe for AdapterSnapshot
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.