Struct cache_loader_async::backing::HashMapBacking
source · [−]pub struct HashMapBacking<K, V> { /* private fields */ }
Implementations
sourceimpl<K, V> HashMapBacking<K, V>
impl<K, V> HashMapBacking<K, V>
pub fn new() -> HashMapBacking<K, V>
pub fn construct(map: HashMap<K, V>) -> HashMapBacking<K, V>
Trait Implementations
sourceimpl<K: Eq + Hash + Sized + Clone + Send, V: Sized + Clone + Send> CacheBacking<K, V> for HashMapBacking<K, V>
impl<K: Eq + Hash + Sized + Clone + Send, V: Sized + Clone + Send> CacheBacking<K, V> for HashMapBacking<K, V>
type Meta = NoMeta
fn get_mut(&mut self, key: &K) -> Result<Option<&mut V>, BackingError>
fn get(&mut self, key: &K) -> Result<Option<&V>, BackingError>
fn set(
&mut self,
key: K,
value: V,
_meta: Option<Self::Meta>
) -> Result<Option<V>, BackingError>
fn remove(&mut self, key: &K) -> Result<Option<V>, BackingError>
fn contains_key(&mut self, key: &K) -> Result<bool, BackingError>
fn remove_if(
&mut self,
predicate: Box<dyn Fn((&K, &V)) -> bool + Send + Sync>
) -> Result<Vec<(K, V)>, BackingError>
fn clear(&mut self) -> Result<(), BackingError>
Auto Trait Implementations
impl<K, V> RefUnwindSafe for HashMapBacking<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for HashMapBacking<K, V>where
K: Send,
V: Send,
impl<K, V> Sync for HashMapBacking<K, V>where
K: Sync,
V: Sync,
impl<K, V> Unpin for HashMapBacking<K, V>where
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for HashMapBacking<K, V>where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more