pub struct TypedCache<T> { /* private fields */ }Expand description
A typed cache that stores and returns values of a specific type.
Implementations§
Source§impl<T> TypedCache<T>
impl<T> TypedCache<T>
Sourcepub async fn execute<F, Fut, E>(&self, f: F) -> Result<T, E>
pub async fn execute<F, Fut, E>(&self, f: F) -> Result<T, E>
Execute the operation, returning cached value if available.
Sourcepub async fn invalidate(&self)
pub async fn invalidate(&self)
Clear the cached value.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for TypedCache<T>
impl<T> !RefUnwindSafe for TypedCache<T>
impl<T> Send for TypedCache<T>
impl<T> Sync for TypedCache<T>
impl<T> Unpin for TypedCache<T>
impl<T> !UnwindSafe for TypedCache<T>
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