pub struct CachedStorage<S> { /* private fields */ }Expand description
Cached storage wrapper.
Wraps any storage backend with an LRU cache for improved read performance.
Implementations§
Source§impl<S> CachedStorage<S>
impl<S> CachedStorage<S>
Sourcepub fn new(inner: S, config: CacheConfig) -> Self
pub fn new(inner: S, config: CacheConfig) -> Self
Creates a new cached storage wrapper.
Sourcepub fn with_defaults(inner: S) -> Self
pub fn with_defaults(inner: S) -> Self
Creates a cached storage with default configuration.
Sourcepub fn config(&self) -> &CacheConfig
pub fn config(&self) -> &CacheConfig
Returns the cache configuration.
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
Returns current cache statistics.
Sourcepub fn invalidate(&self, id: &ObjectId)
pub fn invalidate(&self, id: &ObjectId)
Invalidates a specific object from the cache.
Source§impl<S> CachedStorage<S>where
S: ObjectStoreBackend,
impl<S> CachedStorage<S>where
S: ObjectStoreBackend,
Trait Implementations§
Source§impl<S> ObjectStoreBackend for CachedStorage<S>where
S: ObjectStoreBackend,
impl<S> ObjectStoreBackend for CachedStorage<S>where
S: ObjectStoreBackend,
Auto Trait Implementations§
impl<S> !Freeze for CachedStorage<S>
impl<S> !RefUnwindSafe for CachedStorage<S>
impl<S> Send for CachedStorage<S>where
S: Send,
impl<S> Sync for CachedStorage<S>where
S: Sync,
impl<S> Unpin for CachedStorage<S>where
S: Unpin,
impl<S> UnwindSafe for CachedStorage<S>where
S: UnwindSafe,
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