pub struct LruLocalStore { /* private fields */ }Expand description
The default LRU store.
Implementations§
Source§impl LruLocalStore
impl LruLocalStore
Trait Implementations§
Source§impl Debug for LruLocalStore
impl Debug for LruLocalStore
Source§impl LocalStore for LruLocalStore
impl LocalStore for LruLocalStore
Source§fn get(&mut self, key: &str, now_ms: i64) -> Result<LocalRead, BoxError>
fn get(&mut self, key: &str, now_ms: i64) -> Result<LocalRead, BoxError>
Read one key. A live entry is promoted and returned; an expired entry
is removed without promotion and handed back so the cache can drop it
outside its lock.
Source§fn put(
&mut self,
key: String,
entry: LocalEntry,
) -> Result<Option<LocalEntry>, BoxError>
fn put( &mut self, key: String, entry: LocalEntry, ) -> Result<Option<LocalEntry>, BoxError>
Insert or replace an entry, promoting it and evicting at capacity.
Returns the displaced entry (the replaced value or the evicted tail),
which the cache drops outside its lock.
Auto Trait Implementations§
impl !RefUnwindSafe for LruLocalStore
impl !UnwindSafe for LruLocalStore
impl Freeze for LruLocalStore
impl Send for LruLocalStore
impl Sync for LruLocalStore
impl Unpin for LruLocalStore
impl UnsafeUnpin for LruLocalStore
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