pub struct CachedResult<T> {
pub value: T,
pub created_at: Instant,
pub last_accessed: Instant,
pub access_count: u64,
pub ttl: Option<Duration>,
}Expand description
A cached query result with metadata.
Fields§
§value: TThe cached value
created_at: InstantWhen this entry was created
last_accessed: InstantWhen this entry was last accessed
access_count: u64Number of times this entry has been accessed
ttl: Option<Duration>Time-to-live for this entry
Implementations§
Source§impl<T> CachedResult<T>
impl<T> CachedResult<T>
Trait Implementations§
Source§impl<T: Clone> Clone for CachedResult<T>
impl<T: Clone> Clone for CachedResult<T>
Source§fn clone(&self) -> CachedResult<T>
fn clone(&self) -> CachedResult<T>
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 moreAuto Trait Implementations§
impl<T> Freeze for CachedResult<T>where
T: Freeze,
impl<T> RefUnwindSafe for CachedResult<T>where
T: RefUnwindSafe,
impl<T> Send for CachedResult<T>where
T: Send,
impl<T> Sync for CachedResult<T>where
T: Sync,
impl<T> Unpin for CachedResult<T>where
T: Unpin,
impl<T> UnwindSafe for CachedResult<T>where
T: UnwindSafe,
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