pub struct ReadThroughCache<B, S, M, K, V, L>{ /* private fields */ }Expand description
A cache wrapper that automatically loads data on miss
Implementations§
Source§impl<B, S, M, K, V, L> ReadThroughCache<B, S, M, K, V, L>where
B: CacheBackend + DependencyBackend,
S: Serializer,
M: CacheMetrics,
K: CacheKey + Clone + Send + Sync + 'static,
V: Serialize + DeserializeOwned + Send + Sync + Clone + 'static,
L: Loader<K, V>,
impl<B, S, M, K, V, L> ReadThroughCache<B, S, M, K, V, L>where
B: CacheBackend + DependencyBackend,
S: Serializer,
M: CacheMetrics,
K: CacheKey + Clone + Send + Sync + 'static,
V: Serialize + DeserializeOwned + Send + Sync + Clone + 'static,
L: Loader<K, V>,
Sourcepub fn new(
manager: CacheManager<B, S, M>,
loader: L,
options: CacheOptions,
) -> Self
pub fn new( manager: CacheManager<B, S, M>, loader: L, options: CacheOptions, ) -> Self
Create a new ReadThroughCache
Auto Trait Implementations§
impl<B, S, M, K, V, L> Freeze for ReadThroughCache<B, S, M, K, V, L>
impl<B, S, M, K, V, L> !RefUnwindSafe for ReadThroughCache<B, S, M, K, V, L>
impl<B, S, M, K, V, L> Send for ReadThroughCache<B, S, M, K, V, L>
impl<B, S, M, K, V, L> Sync for ReadThroughCache<B, S, M, K, V, L>
impl<B, S, M, K, V, L> Unpin for ReadThroughCache<B, S, M, K, V, L>
impl<B, S, M, K, V, L> !UnwindSafe for ReadThroughCache<B, S, M, K, V, L>
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