pub struct DnsCacheEntry {
pub addresses: Vec<IpAddr>,
pub created_at: Instant,
pub ttl: Duration,
pub hit_count: u64,
pub last_accessed: Instant,
}Expand description
DNS cache entry
Fields§
§addresses: Vec<IpAddr>Resolved IP addresses
created_at: InstantTime when entry was created
ttl: DurationTime-to-live for this entry
hit_count: u64Number of times this entry has been used
last_accessed: InstantLast time this entry was accessed
Implementations§
Source§impl DnsCacheEntry
impl DnsCacheEntry
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if this entry is expired
Sourcepub fn mark_accessed(&mut self)
pub fn mark_accessed(&mut self)
Update access statistics
Trait Implementations§
Source§impl Clone for DnsCacheEntry
impl Clone for DnsCacheEntry
Source§fn clone(&self) -> DnsCacheEntry
fn clone(&self) -> DnsCacheEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DnsCacheEntry
impl RefUnwindSafe for DnsCacheEntry
impl Send for DnsCacheEntry
impl Sync for DnsCacheEntry
impl Unpin for DnsCacheEntry
impl UnsafeUnpin for DnsCacheEntry
impl UnwindSafe for DnsCacheEntry
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