Struct CacheEntry
pub struct CacheEntry { /* private fields */ }Expand description
A modeled cache entry.
Implementations§
§impl CacheEntry
impl CacheEntry
pub const fn new(key: CacheKey, value: CacheValue) -> CacheEntry
pub const fn new(key: CacheKey, value: CacheValue) -> CacheEntry
Creates a cache entry.
pub const fn with_ttl(self, ttl: Ttl) -> CacheEntry
pub const fn with_ttl(self, ttl: Ttl) -> CacheEntry
Sets the TTL.
pub const fn with_status(self, status: CacheStatus) -> CacheEntry
pub const fn with_status(self, status: CacheStatus) -> CacheEntry
Sets the cache status.
pub const fn value(&self) -> &CacheValue
pub const fn value(&self) -> &CacheValue
Returns the value.
pub const fn status(&self) -> CacheStatus
pub const fn status(&self) -> CacheStatus
Returns the status.
Trait Implementations§
§impl Clone for CacheEntry
impl Clone for CacheEntry
§fn clone(&self) -> CacheEntry
fn clone(&self) -> CacheEntry
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 more§impl Debug for CacheEntry
impl Debug for CacheEntry
§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 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