pub struct CacheValue {
pub entries: Vec<FileEntry>,
pub stored_at: SystemTime,
pub ttl: Option<Duration>,
}Expand description
Cached discovery result.
Fields§
§entries: Vec<FileEntry>Cached entries.
stored_at: SystemTimeWhen the value was stored.
ttl: Option<Duration>Optional TTL override for this value.
Implementations§
Source§impl CacheValue
impl CacheValue
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Returns true if the entry is past its TTL.
Sourcepub fn is_expired_with_default(&self, default_ttl: Option<Duration>) -> bool
pub fn is_expired_with_default(&self, default_ttl: Option<Duration>) -> bool
Returns true if expired given a default TTL when self.ttl is None.
Trait Implementations§
Source§impl Clone for CacheValue
impl Clone for CacheValue
Source§fn clone(&self) -> CacheValue
fn clone(&self) -> CacheValue
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 CacheValue
impl RefUnwindSafe for CacheValue
impl Send for CacheValue
impl Sync for CacheValue
impl Unpin for CacheValue
impl UnsafeUnpin for CacheValue
impl UnwindSafe for CacheValue
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