pub struct VirtualList { /* private fields */ }Expand description
Virtualized list state
Implementations§
Source§impl VirtualList
impl VirtualList
pub fn new(config: VirtualListConfig) -> Self
Sourcepub fn set_item_count(&mut self, count: usize)
pub fn set_item_count(&mut self, count: usize)
Set total item count
Sourcepub fn item_count(&self) -> usize
pub fn item_count(&self) -> usize
Get total item count
Sourcepub fn set_viewport_height(&mut self, height: f32)
pub fn set_viewport_height(&mut self, height: f32)
Set viewport height
Sourcepub fn viewport_height(&self) -> f32
pub fn viewport_height(&self) -> f32
Get viewport height
Sourcepub fn set_scroll_position(&mut self, position: f32)
pub fn set_scroll_position(&mut self, position: f32)
Set scroll position
Sourcepub fn scroll_position(&self) -> f32
pub fn scroll_position(&self) -> f32
Get current scroll position
Sourcepub fn max_scroll(&self) -> f32
pub fn max_scroll(&self) -> f32
Get maximum scroll position
Sourcepub fn scroll_to_item(&mut self, index: usize, align: ScrollAlign)
pub fn scroll_to_item(&mut self, index: usize, align: ScrollAlign)
Scroll to specific item
Sourcepub fn set_item_height(&mut self, index: usize, height: f32)
pub fn set_item_height(&mut self, index: usize, height: f32)
Set height for a specific item
Sourcepub fn get_item_height(&self, index: usize) -> f32
pub fn get_item_height(&self, index: usize) -> f32
Get height for a specific item
Sourcepub fn get_item_position(&self, index: usize) -> f32
pub fn get_item_position(&self, index: usize) -> f32
Get position for a specific item
Sourcepub fn get_item_layout(&self, index: usize) -> ItemLayout
pub fn get_item_layout(&self, index: usize) -> ItemLayout
Get layout for a specific item
Sourcepub fn content_height(&self) -> f32
pub fn content_height(&self) -> f32
Get total content height
Sourcepub fn visible_range(&self) -> Option<&VisibleRange>
pub fn visible_range(&self) -> Option<&VisibleRange>
Get currently visible range
Sourcepub fn is_near_end(&self) -> bool
pub fn is_near_end(&self) -> bool
Check if we’re near the end (for infinite scroll)
Sourcepub fn is_near_start(&self) -> bool
pub fn is_near_start(&self) -> bool
Check if we’re near the start
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VirtualList
impl RefUnwindSafe for VirtualList
impl Send for VirtualList
impl Sync for VirtualList
impl Unpin for VirtualList
impl UnwindSafe for VirtualList
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().