pub struct CacheEntry {
pub record: MdnsRecord,
pub inserted_tick: u64,
pub original_ttl: u32,
}Expand description
A cached mDNS record with expiry tracking
Fields§
§record: MdnsRecordThe resource record
inserted_tick: u64Tick count when this entry was inserted
original_ttl: u32TTL in seconds at insertion time
Implementations§
Source§impl CacheEntry
impl CacheEntry
Sourcepub fn is_expired(&self, current_tick: u64, ticks_per_sec: u64) -> bool
pub fn is_expired(&self, current_tick: u64, ticks_per_sec: u64) -> bool
Check if this entry has expired given the current tick and ticks-per-second
Sourcepub fn remaining_ttl(&self, current_tick: u64, ticks_per_sec: u64) -> u32
pub fn remaining_ttl(&self, current_tick: u64, ticks_per_sec: u64) -> u32
Remaining TTL in seconds
Trait Implementations§
Source§impl Clone for CacheEntry
impl Clone for CacheEntry
Source§fn clone(&self) -> CacheEntry
fn clone(&self) -> CacheEntry
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CacheEntry
impl Debug for CacheEntry
Source§impl PartialEq for CacheEntry
impl PartialEq for CacheEntry
impl Eq for CacheEntry
impl StructuralPartialEq for CacheEntry
Auto Trait Implementations§
impl Freeze for CacheEntry
impl RefUnwindSafe for CacheEntry
impl Send for CacheEntry
impl Sync for CacheEntry
impl Unpin for CacheEntry
impl UnwindSafe for CacheEntry
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)