pub struct AsyncCache<K, V>{ /* private fields */ }Expand description
A cache where reads are wait-free and where writes are asynchronous, such as it can be used within code that cannot block.
Implementations§
Source§impl<K, V> AsyncCache<K, V>
impl<K, V> AsyncCache<K, V>
pub fn new() -> Self
Sourcepub fn read<BK>(&self, key: &BK) -> Option<V>
pub fn read<BK>(&self, key: &BK) -> Option<V>
Reads the cached entry for the given key.
Note that this will not block.
Trait Implementations§
Source§impl<K, V> Clone for AsyncCache<K, V>
impl<K, V> Clone for AsyncCache<K, V>
Source§fn clone(&self) -> AsyncCache<K, V>
fn clone(&self) -> AsyncCache<K, V>
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 moreSource§impl<K, V> Debug for AsyncCache<K, V>
impl<K, V> Debug for AsyncCache<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for AsyncCache<K, V>
impl<K, V> !RefUnwindSafe for AsyncCache<K, V>
impl<K, V> Send for AsyncCache<K, V>
impl<K, V> Sync for AsyncCache<K, V>
impl<K, V> Unpin for AsyncCache<K, V>
impl<K, V> !UnwindSafe for AsyncCache<K, V>
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