pub struct PrefetchScheduler { /* private fields */ }Expand description
Scheduler that tracks which items should be prefetched.
Based on scroll direction and velocity, determines which items to pre-compose before they become visible.
Implementations§
Source§impl PrefetchScheduler
impl PrefetchScheduler
Sourcepub fn update(
&mut self,
first_visible_index: usize,
last_visible_index: usize,
total_items: usize,
scroll_direction: f32,
strategy: &PrefetchStrategy,
)
pub fn update( &mut self, first_visible_index: usize, last_visible_index: usize, total_items: usize, scroll_direction: f32, strategy: &PrefetchStrategy, )
Updates the prefetch queue based on current scroll state.
§Arguments
first_visible_index- Index of the first visible itemlast_visible_index- Index of the last visible itemtotal_items- Total number of items in the listscroll_direction- Current scroll direction (positive = forward)strategy- Prefetch strategy to use
Sourcepub fn next_prefetch(&mut self) -> Option<usize>
pub fn next_prefetch(&mut self) -> Option<usize>
Returns the next item index to prefetch, if any.
Sourcepub fn pending_prefetches(&self) -> &VecDeque<usize>
pub fn pending_prefetches(&self) -> &VecDeque<usize>
Returns all pending prefetch indices.
Trait Implementations§
Source§impl Debug for PrefetchScheduler
impl Debug for PrefetchScheduler
Source§impl Default for PrefetchScheduler
impl Default for PrefetchScheduler
Source§fn default() -> PrefetchScheduler
fn default() -> PrefetchScheduler
Returns the “default value” for a type. Read more
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