pub struct PrefetchScheduler { /* private fields */ }Expand description
Prefetch scheduler
Implementations§
Source§impl PrefetchScheduler
impl PrefetchScheduler
Sourcepub fn new(strategy: PrefetchStrategy, max_concurrent: usize) -> Self
pub fn new(strategy: PrefetchStrategy, max_concurrent: usize) -> Self
Create a new prefetch scheduler
Sourcepub fn set_strategy(&self, strategy: PrefetchStrategy)
pub fn set_strategy(&self, strategy: PrefetchStrategy)
Update the prefetch strategy
Sourcepub fn strategy(&self) -> PrefetchStrategy
pub fn strategy(&self) -> PrefetchStrategy
Get current strategy
Sourcepub fn schedule(&self, task: PrefetchTask) -> Option<u64>
pub fn schedule(&self, task: PrefetchTask) -> Option<u64>
Schedule a prefetch task
Sourcepub fn schedule_adjacent(
&self,
study_id: &str,
series_id: &str,
current_slice: usize,
total_slices: usize,
quality: ImageQuality,
target_tier: CacheTier,
)
pub fn schedule_adjacent( &self, study_id: &str, series_id: &str, current_slice: usize, total_slices: usize, quality: ImageQuality, target_tier: CacheTier, )
Schedule prefetch for adjacent slices
Sourcepub fn schedule_thumbnails(
&self,
study_id: &str,
series_id: &str,
total_slices: usize,
)
pub fn schedule_thumbnails( &self, study_id: &str, series_id: &str, total_slices: usize, )
Schedule thumbnails for all slices in a series
Sourcepub fn next_task(&self) -> Option<PrefetchTask>
pub fn next_task(&self) -> Option<PrefetchTask>
Get next task to execute
Sourcepub fn complete_task(&self, task_id: u64, success: bool)
pub fn complete_task(&self, task_id: u64, success: bool)
Mark a task as completed
Sourcepub fn cancel_task(&self, task_id: u64) -> bool
pub fn cancel_task(&self, task_id: u64) -> bool
Cancel a pending task
Sourcepub fn clear_queue(&self)
pub fn clear_queue(&self)
Clear all pending tasks
Sourcepub fn state(&self) -> PrefetchState
pub fn state(&self) -> PrefetchState
Get scheduler state
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PrefetchScheduler
impl RefUnwindSafe for PrefetchScheduler
impl Send for PrefetchScheduler
impl Sync for PrefetchScheduler
impl Unpin 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