Skip to main content

yew_virtual/core/
visible_range.rs

1/// Describes the visible range of items in a virtualized list.
2///
3/// Contains the start and end indices of the visible viewport along
4/// with the overscan and total count used to compute the rendered
5/// index set. This type is passed to custom range extractors.
6#[derive(Debug, Clone, Copy, PartialEq, Eq)]
7pub struct VisibleRange {
8    /// The first visible item index (inclusive).
9    pub start_index: usize,
10
11    /// The last visible item index (inclusive).
12    pub end_index: usize,
13
14    /// The number of extra items beyond the viewport.
15    pub overscan: usize,
16
17    /// The total number of items in the dataset.
18    pub count: usize,
19}