pub struct VecCache<T: 'static + Copy + Default> {
vec: Box<[T]>,
dirty: bool,
}
Expand description
Represents a vector that implements the Cacheable
trait so it can be held in a cache.
Fields§
§vec: Box<[T]>
§dirty: bool
Implementations§
source§impl<T: 'static + Copy + Default> VecCache<T>
impl<T: 'static + Copy + Default> VecCache<T>
pub fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>where
I: SliceIndex<[T]>,
sourcepub fn get_values(&self) -> &[T]
pub fn get_values(&self) -> &[T]
Gets a reference to the underlying vector.
sourcepub fn mark_clean(&mut self)
pub fn mark_clean(&mut self)
Mark this cache element as clean.
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for VecCache<T>where
T: RefUnwindSafe,
impl<T> Send for VecCache<T>where
T: Send,
impl<T> Sync for VecCache<T>where
T: Sync,
impl<T> Unpin for VecCache<T>
impl<T> UnwindSafe for VecCache<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