pub struct PrefetchScheduler { /* private fields */ }Expand description
Collects prefetch hints and can return them in priority order.
Implementations§
Source§impl PrefetchScheduler
impl PrefetchScheduler
Sourcepub fn new(max_prefetch_bytes: usize) -> Self
pub fn new(max_prefetch_bytes: usize) -> Self
Creates a new PrefetchScheduler with the given byte cap.
Sourcepub fn add_hint(&mut self, hint: PrefetchHint)
pub fn add_hint(&mut self, hint: PrefetchHint)
Adds a prefetch hint.
Sourcepub fn sorted_hints(&self) -> Vec<&PrefetchHint>
pub fn sorted_hints(&self) -> Vec<&PrefetchHint>
Returns hints sorted by descending priority, then ascending offset.
Sourcepub fn hint_count(&self) -> usize
pub fn hint_count(&self) -> usize
Returns the number of hints currently held.
Sourcepub fn total_bytes_hinted(&self) -> usize
pub fn total_bytes_hinted(&self) -> usize
Returns the sum of all hinted lengths.
Sourcepub fn max_prefetch_bytes(&self) -> usize
pub fn max_prefetch_bytes(&self) -> usize
Returns the configured maximum prefetch byte limit.
Auto Trait Implementations§
impl Freeze for PrefetchScheduler
impl RefUnwindSafe for PrefetchScheduler
impl Send for PrefetchScheduler
impl Sync for PrefetchScheduler
impl Unpin for PrefetchScheduler
impl UnsafeUnpin for PrefetchScheduler
impl UnwindSafe for PrefetchScheduler
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