pub struct PrefetchManager { /* private fields */ }Expand description
Comprehensive prefetch manager
Implementations§
Source§impl PrefetchManager
impl PrefetchManager
Sourcepub fn new(config: PrefetchConfig) -> Self
pub fn new(config: PrefetchConfig) -> Self
Creates a new prefetch manager
Sourcepub async fn record_access(&self, record: AccessRecord) -> Vec<PrefetchTarget>
pub async fn record_access(&self, record: AccessRecord) -> Vec<PrefetchTarget>
Records an access and triggers prefetching
Sourcepub async fn can_prefetch(&self, size: usize) -> bool
pub async fn can_prefetch(&self, size: usize) -> bool
Checks if prefetching is allowed (memory and bandwidth)
Sourcepub async fn record_prefetch(&self, size: usize, used: bool, latency: Duration)
pub async fn record_prefetch(&self, size: usize, used: bool, latency: Duration)
Records a completed prefetch
Sourcepub fn allocate_memory(&self, size: usize) -> bool
pub fn allocate_memory(&self, size: usize) -> bool
Allocates memory for a prefetch
Sourcepub fn release_memory(&self, size: usize)
pub fn release_memory(&self, size: usize)
Releases memory from a prefetch
Sourcepub async fn next_target(&self) -> Option<PrefetchTarget>
pub async fn next_target(&self) -> Option<PrefetchTarget>
Gets the next prefetch target from the queue
Sourcepub async fn current_pattern(&self) -> AccessPattern
pub async fn current_pattern(&self) -> AccessPattern
Returns the current access pattern
Sourcepub fn memory_pressure(&self) -> f64
pub fn memory_pressure(&self) -> f64
Gets memory pressure (0.0 - 1.0)
Sourcepub fn remaining_bandwidth(&self) -> usize
pub fn remaining_bandwidth(&self) -> usize
Gets remaining bandwidth
Auto Trait Implementations§
impl !RefUnwindSafe for PrefetchManager
impl !UnwindSafe for PrefetchManager
impl Freeze for PrefetchManager
impl Send for PrefetchManager
impl Sync for PrefetchManager
impl Unpin for PrefetchManager
impl UnsafeUnpin for PrefetchManager
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