pub struct CacheStore { /* private fields */ }Expand description
Cache storage for prerendered content
Implementations§
Source§impl CacheStore
impl CacheStore
pub fn new(refresh_trigger: RefreshTrigger, cache_404_capacity: usize) -> Self
pub async fn get(&self, key: &str) -> Option<CachedResponse>
Sourcepub async fn get_404(&self, key: &str) -> Option<CachedResponse>
pub async fn get_404(&self, key: &str) -> Option<CachedResponse>
Get a 404 cached response (if present)
pub async fn set(&self, key: String, response: CachedResponse)
Sourcepub async fn set_404(&self, key: String, response: CachedResponse)
pub async fn set_404(&self, key: String, response: CachedResponse)
Set a 404 cached response. Bounded by cache_404_capacity and evict the oldest entries when limit reached.
pub async fn clear(&self)
Sourcepub async fn clear_by_pattern(&self, pattern: &str)
pub async fn clear_by_pattern(&self, pattern: &str)
Clear cache entries matching a pattern (supports wildcards)
pub fn refresh_trigger(&self) -> &RefreshTrigger
Trait Implementations§
Source§impl Clone for CacheStore
impl Clone for CacheStore
Source§fn clone(&self) -> CacheStore
fn clone(&self) -> CacheStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CacheStore
impl !RefUnwindSafe for CacheStore
impl Send for CacheStore
impl Sync for CacheStore
impl Unpin for CacheStore
impl !UnwindSafe for CacheStore
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