pub struct PrefetchCache { /* private fields */ }Expand description
Prefetch cache for storing prefetched data
Implementations§
Source§impl PrefetchCache
impl PrefetchCache
pub fn new(size_limit: usize) -> Self
Sourcepub fn insert(
&mut self,
address: usize,
data: Vec<u8>,
strategy: String,
) -> bool
pub fn insert( &mut self, address: usize, data: Vec<u8>, strategy: String, ) -> bool
Insert prefetched data into cache
Sourcepub fn get(&mut self, address: usize, size: usize) -> Option<&[u8]>
pub fn get(&mut self, address: usize, size: usize) -> Option<&[u8]>
Check if data is in cache and mark as accessed
Sourcepub fn get_stats(&self) -> &CacheStats
pub fn get_stats(&self) -> &CacheStats
Get cache statistics
Auto Trait Implementations§
impl Freeze for PrefetchCache
impl RefUnwindSafe for PrefetchCache
impl Send for PrefetchCache
impl Sync for PrefetchCache
impl Unpin for PrefetchCache
impl UnwindSafe for PrefetchCache
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more