pub struct IpChange {
pub adapter: String,
pub address: IpAddr,
pub timestamp: SystemTime,
pub kind: IpChangeKind,
}Expand description
An IP address change event.
Represents a single IP address being added or removed from a network adapter.
Fields§
§adapter: StringThe name of the adapter where the change occurred.
address: IpAddrThe IP address that was added or removed.
timestamp: SystemTimeThe timestamp when the change was detected.
kind: IpChangeKindWhether the address was added or removed.
Implementations§
Source§impl IpChange
impl IpChange
Sourcepub fn new(
adapter: impl Into<String>,
address: IpAddr,
timestamp: SystemTime,
kind: IpChangeKind,
) -> Self
pub fn new( adapter: impl Into<String>, address: IpAddr, timestamp: SystemTime, kind: IpChangeKind, ) -> Self
Creates a new IP change event.
Sourcepub fn added(
adapter: impl Into<String>,
address: IpAddr,
timestamp: SystemTime,
) -> Self
pub fn added( adapter: impl Into<String>, address: IpAddr, timestamp: SystemTime, ) -> Self
Creates an “added” change event.
Sourcepub fn removed(
adapter: impl Into<String>,
address: IpAddr,
timestamp: SystemTime,
) -> Self
pub fn removed( adapter: impl Into<String>, address: IpAddr, timestamp: SystemTime, ) -> Self
Creates a “removed” change event.
Sourcepub const fn is_removed(&self) -> bool
pub const fn is_removed(&self) -> bool
Returns true if this is a “removed” change.
Sourcepub const fn matches_version(&self, version: IpVersion) -> bool
pub const fn matches_version(&self, version: IpVersion) -> bool
Returns true if this change matches the specified IP version filter.
Trait Implementations§
impl Eq for IpChange
impl StructuralPartialEq for IpChange
Auto Trait Implementations§
impl Freeze for IpChange
impl RefUnwindSafe for IpChange
impl Send for IpChange
impl Sync for IpChange
impl Unpin for IpChange
impl UnwindSafe for IpChange
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.