pub struct Item { /* private fields */ }Expand description
A read-only view of an item stored in the cuckoo cache.
Implementations§
Source§impl Item
impl Item
Sourcepub fn expire(&self) -> u32
pub fn expire(&self) -> u32
The item’s expiration timestamp as seconds since cache creation.
Returns u32::MAX for items with no expiry.
Sourcepub fn wrapping_add(&mut self, rhs: u64) -> Result<(), CuckooCacheError>
pub fn wrapping_add(&mut self, rhs: u64) -> Result<(), CuckooCacheError>
Perform a wrapping addition on the value.
Sourcepub fn saturating_sub(&mut self, rhs: u64) -> Result<(), CuckooCacheError>
pub fn saturating_sub(&mut self, rhs: u64) -> Result<(), CuckooCacheError>
Perform a saturating subtraction on the value.
Trait Implementations§
Auto Trait Implementations§
impl !Send for Item
impl !Sync for Item
impl Freeze for Item
impl RefUnwindSafe for Item
impl Unpin for Item
impl UnsafeUnpin for Item
impl UnwindSafe for Item
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