pub struct VirtualListMetrics { /* private fields */ }Implementations§
Source§impl VirtualListMetrics
impl VirtualListMetrics
pub fn ensure_with_mode( &mut self, mode: VirtualListMeasureMode, len: usize, estimate: Px, gap: Px, scroll_margin: Px, )
pub fn ensure(&mut self, len: usize, estimate: Px, gap: Px, scroll_margin: Px)
pub fn sync_keys(&mut self, keys: &[ItemKey], items_revision: u64)
pub fn total_height(&self) -> Px
pub fn virtual_item(&self, index: usize, key: ItemKey) -> VirtualItem
pub fn estimate(&self) -> Px
pub fn gap(&self) -> Px
pub fn scroll_margin(&self) -> Px
pub fn is_measured(&self, index: usize) -> bool
pub fn reset_measured_cache_if_cross_extent_changed( &mut self, cross_extent: Px, ) -> bool
pub fn height_at(&self, index: usize) -> Px
pub fn offset_for_index(&self, index: usize) -> Px
pub fn end_for_index(&self, index: usize) -> Px
pub fn index_for_offset(&self, offset: Px) -> usize
pub fn end_index_for_offset(&self, offset: Px) -> usize
pub fn set_measured_height(&mut self, index: usize, height: Px) -> bool
pub fn clamp_offset(&self, offset_y: Px, viewport_h: Px) -> Px
Sourcepub fn visible_range(
&self,
offset_y: Px,
viewport_h: Px,
overscan: usize,
) -> Option<VirtualRange>
pub fn visible_range( &self, offset_y: Px, viewport_h: Px, overscan: usize, ) -> Option<VirtualRange>
Computes the visible item range for a vertical viewport.
offset_y is the current scroll offset, clamped by the caller as needed.
Returns a VirtualRange with inclusive indices (start_index..=end_index).
pub fn scroll_offset_for_item( &self, index: usize, viewport_h: Px, current_offset_y: Px, strategy: ScrollStrategy, ) -> Px
pub fn rebuild_from_heights( &mut self, heights: Vec<Px>, measured: Vec<bool>, estimate: Px, gap: Px, scroll_margin: Px, )
pub fn rebuild_from_known_heights( &mut self, heights: Vec<Px>, estimate: Px, gap: Px, scroll_margin: Px, )
Trait Implementations§
Source§impl Clone for VirtualListMetrics
impl Clone for VirtualListMetrics
Source§fn clone(&self) -> VirtualListMetrics
fn clone(&self) -> VirtualListMetrics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VirtualListMetrics
impl Debug for VirtualListMetrics
Auto Trait Implementations§
impl !Freeze for VirtualListMetrics
impl !RefUnwindSafe for VirtualListMetrics
impl Send for VirtualListMetrics
impl !Sync for VirtualListMetrics
impl Unpin for VirtualListMetrics
impl UnsafeUnpin for VirtualListMetrics
impl !UnwindSafe for VirtualListMetrics
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