pub struct CacheEntry { /* private fields */ }Expand description
A modeled cache entry.
Implementations§
Source§impl CacheEntry
impl CacheEntry
Sourcepub const fn new(key: CacheKey, value: CacheValue) -> CacheEntry
pub const fn new(key: CacheKey, value: CacheValue) -> CacheEntry
Creates a cache entry.
Sourcepub const fn with_ttl(self, ttl: Ttl) -> CacheEntry
pub const fn with_ttl(self, ttl: Ttl) -> CacheEntry
Sets the TTL.
Sourcepub const fn with_status(self, status: CacheStatus) -> CacheEntry
pub const fn with_status(self, status: CacheStatus) -> CacheEntry
Sets the cache status.
Sourcepub const fn value(&self) -> &CacheValue
pub const fn value(&self) -> &CacheValue
Returns the value.
Sourcepub const fn status(&self) -> CacheStatus
pub const fn status(&self) -> CacheStatus
Returns the status.
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 (const: unstable) · Source§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
Source§fn eq(&self, other: &CacheEntry) -> bool
fn eq(&self, other: &CacheEntry) -> bool
Tests for
self and other values to be equal, and is used by ==.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 UnsafeUnpin for CacheEntry
impl UnwindSafe for CacheEntry
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