pub struct InMemoryCache { /* private fields */ }Expand description
Keeps cached responses for the life of the process.
Implementations§
Source§impl InMemoryCache
impl InMemoryCache
Sourcepub fn new() -> InMemoryCache
pub fn new() -> InMemoryCache
An empty cache.
Trait Implementations§
Source§impl Debug for InMemoryCache
impl Debug for InMemoryCache
Source§impl Default for InMemoryCache
impl Default for InMemoryCache
Source§fn default() -> InMemoryCache
fn default() -> InMemoryCache
Returns the “default value” for a type. Read more
Source§impl ResponseCache for InMemoryCache
impl ResponseCache for InMemoryCache
Source§fn set(&self, key: &str, response: CachedResponse)
fn set(&self, key: &str, response: CachedResponse)
Holds a response under
key, replacing whatever was there.Source§fn invalidate(&self, key: &str)
fn invalidate(&self, key: &str)
Forgets what is held under
key.Auto Trait Implementations§
impl !Freeze for InMemoryCache
impl RefUnwindSafe for InMemoryCache
impl Send for InMemoryCache
impl Sync for InMemoryCache
impl Unpin for InMemoryCache
impl UnsafeUnpin for InMemoryCache
impl UnwindSafe for InMemoryCache
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