pub struct LruCacheStore<S>where
S: StoreBase,{ /* private fields */ }Expand description
A Store implementation that wraps an inner Store
and ads an LRU (least-recently-used) cache around it.
The cache is write-through, i.e. there is no speedup when writing to the store.
Furthermore, the implementation is not Send or Sync.
A common patthern would be to have one LruCacheStore per thread wrapping an inner store.
Implementations§
Trait Implementations§
Source§impl<S> AppendableStore for LruCacheStore<S>
impl<S> AppendableStore for LruCacheStore<S>
Source§impl<S> AsyncAppendableStore for LruCacheStore<S>
impl<S> AsyncAppendableStore for LruCacheStore<S>
Source§impl<S> AsyncOrderedStoreRead for LruCacheStore<S>
impl<S> AsyncOrderedStoreRead for LruCacheStore<S>
Source§impl<S> AsyncSearchableStoreRead for LruCacheStore<S>
impl<S> AsyncSearchableStoreRead for LruCacheStore<S>
Source§async fn filter(
&self,
pred: impl FnMut(&Self::Key, &Self::Value) -> bool,
) -> Vec<(Self::Key, Self::Value)>
async fn filter( &self, pred: impl FnMut(&Self::Key, &Self::Value) -> bool, ) -> Vec<(Self::Key, Self::Value)>
Search for all entries in the store, that fulfill a certain predicate Read more
async fn find( &self, pred: impl FnMut(&Self::Key, &Self::Value) -> bool, ) -> Option<(Self::Key, Self::Value)>
Source§impl<S> AsyncStoreRead for LruCacheStore<S>
impl<S> AsyncStoreRead for LruCacheStore<S>
Source§impl<S> AsyncStoreWrite for LruCacheStore<S>
impl<S> AsyncStoreWrite for LruCacheStore<S>
Source§impl<S> Debug for LruCacheStore<S>
impl<S> Debug for LruCacheStore<S>
Source§impl<S> Deref for LruCacheStore<S>where
S: StoreBase,
impl<S> Deref for LruCacheStore<S>where
S: StoreBase,
Source§impl<S> DerefMut for LruCacheStore<S>where
S: Store,
impl<S> DerefMut for LruCacheStore<S>where
S: Store,
Source§impl<S> OrderedStoreRead for LruCacheStore<S>
impl<S> OrderedStoreRead for LruCacheStore<S>
Source§impl<S> SearchableStoreRead for LruCacheStore<S>
impl<S> SearchableStoreRead for LruCacheStore<S>
Source§fn filter(
&self,
pred: impl FnMut(&Self::Key, &Self::Value) -> bool,
) -> Vec<(Self::Key, Self::Value)>
fn filter( &self, pred: impl FnMut(&Self::Key, &Self::Value) -> bool, ) -> Vec<(Self::Key, Self::Value)>
Search for all entries in the store, that fulfill a certain predicate Read more
fn find( &self, pred: impl FnMut(&Self::Key, &Self::Value) -> bool, ) -> Option<(Self::Key, Self::Value)>
Source§impl<S> StoreBase for LruCacheStore<S>where
S: StoreBase,
impl<S> StoreBase for LruCacheStore<S>where
S: StoreBase,
Source§impl<S> StoreRead for LruCacheStore<S>
impl<S> StoreRead for LruCacheStore<S>
Auto Trait Implementations§
impl<S> !Freeze for LruCacheStore<S>
impl<S> !RefUnwindSafe for LruCacheStore<S>
impl<S> !Sync for LruCacheStore<S>
impl<S> Send for LruCacheStore<S>
impl<S> Unpin for LruCacheStore<S>where
S: Unpin,
impl<S> UnsafeUnpin for LruCacheStore<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for LruCacheStore<S>
Blanket Implementations§
impl<T> AsyncOrderedStore for Twhere
T: AsyncOrderedStoreRead + AsyncStoreWrite,
impl<T> AsyncSearchableStore for Twhere
T: AsyncSearchableStoreRead + AsyncStoreWrite,
impl<T> AsyncStore for Twhere
T: AsyncStoreRead + AsyncStoreWrite,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more