pub struct CacheMap<T: Cacheable> {
capacity: usize,
map: HashMap<usize, T>,
}
Fields§
§capacity: usize
§map: HashMap<usize, T>
Implementations§
source§impl<T: Cacheable> CacheMap<T>
impl<T: Cacheable> CacheMap<T>
pub fn new(capacity: usize) -> Self
pub fn contains_key(&self, key: &usize) -> bool
pub fn get(&self, index: &usize) -> Option<&T>
pub fn get_mut(&mut self, index: &usize) -> Option<&mut T>
pub fn iter_mut(&mut self) -> IterMut<'_, usize, T>
pub fn insert<F>( &mut self, index: usize, block: T, write_callback: F ) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for CacheMap<T>where
T: RefUnwindSafe,
impl<T> Send for CacheMap<T>where
T: Send,
impl<T> Sync for CacheMap<T>where
T: Sync,
impl<T> Unpin for CacheMap<T>where
T: Unpin,
impl<T> UnwindSafe for CacheMap<T>where
T: UnwindSafe,
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