Struct moka::future::BlockingOp
source · pub struct BlockingOp<'a, K, V, S>(_);Available on crate feature
future only.Implementations§
source§impl<'a, K, V, S> BlockingOp<'a, K, V, S>where
K: Hash + Eq + Send + Sync + 'static,
V: Clone + Send + Sync + 'static,
S: BuildHasher + Clone + Send + Sync + 'static,
impl<'a, K, V, S> BlockingOp<'a, K, V, S>where K: Hash + Eq + Send + Sync + 'static, V: Clone + Send + Sync + 'static, S: BuildHasher + Clone + Send + Sync + 'static,
sourcepub fn insert(&self, key: K, value: V)
pub fn insert(&self, key: K, value: V)
Inserts a key-value pair into the cache. If the cache has this key present, the value is updated.
This method is intended for use cases where you are inserting from synchronous code.
sourcepub fn invalidate<Q>(&self, key: &Q)where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn invalidate<Q>(&self, key: &Q)where K: Borrow<Q>, Q: Hash + Eq + ?Sized,
Discards any cached value for the key.
This method is intended for use cases where you are invalidating from synchronous code.
The key may be any borrowed form of the cache’s key type, but Hash and Eq
on the borrowed form must match those for the key type.
Auto Trait Implementations§
impl<'a, K, V, S> !RefUnwindSafe for BlockingOp<'a, K, V, S>
impl<'a, K, V, S> Send for BlockingOp<'a, K, V, S>where K: Send + Sync, S: Sync, V: Send + Sync,
impl<'a, K, V, S> Sync for BlockingOp<'a, K, V, S>where K: Send + Sync, S: Sync, V: Send + Sync,
impl<'a, K, V, S> Unpin for BlockingOp<'a, K, V, S>
impl<'a, K, V, S> !UnwindSafe for BlockingOp<'a, K, V, S>
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