pub struct ResponseCache { /* private fields */ }Expand description
Simple TTL-based cache for responses
Implementations§
Source§impl ResponseCache
impl ResponseCache
Sourcepub async fn put_with_ttl(&self, key: String, value: Value, ttl: Duration)
pub async fn put_with_ttl(&self, key: String, value: Value, ttl: Duration)
Put a value with custom TTL
Sourcepub async fn cleanup_expired(&self) -> usize
pub async fn cleanup_expired(&self) -> usize
Clear all expired entries
Auto Trait Implementations§
impl Freeze for ResponseCache
impl !RefUnwindSafe for ResponseCache
impl Send for ResponseCache
impl Sync for ResponseCache
impl Unpin for ResponseCache
impl UnsafeUnpin for ResponseCache
impl !UnwindSafe for ResponseCache
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