pub struct VirtualList {
pub estimate: f64,
pub gap: f64,
/* private fields */
}Expand description
A virtualized list: only the rows in (or near) the viewport are built and laid out;
spacers stand for the rest. Row heights start at an estimate and are learned from
laid-out rows (VirtualList::measure), so long chats stay cheap.
Fields§
§estimate: f64Height of a row not measured yet.
gap: f64Gap between rows.
Implementations§
Source§impl VirtualList
impl VirtualList
pub fn new(len: usize, estimate: f64) -> VirtualList
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn set_len(&mut self, n: usize)
pub fn set_len(&mut self, n: usize)
Grow or shrink to n rows (new rows unmeasured; kept rows keep their height).
Sourcepub fn invalidate(&mut self, i: usize)
pub fn invalidate(&mut self, i: usize)
Forget a row’s height (its content changed).
Sourcepub fn window(&self, scroll: f64, view: f64, overscan: f64) -> Window
pub fn window(&self, scroll: f64, view: f64, overscan: f64) -> Window
The rows covering scroll .. scroll + view, plus overscan pixels each way.
Trait Implementations§
Source§impl Clone for VirtualList
impl Clone for VirtualList
Source§fn clone(&self) -> VirtualList
fn clone(&self) -> VirtualList
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 VirtualList
impl Debug for VirtualList
Source§impl Default for VirtualList
impl Default for VirtualList
Source§fn default() -> VirtualList
fn default() -> VirtualList
Returns the “default value” for a type. Read more
Source§impl PartialEq for VirtualList
impl PartialEq for VirtualList
impl StructuralPartialEq for VirtualList
Auto Trait Implementations§
impl Freeze for VirtualList
impl RefUnwindSafe for VirtualList
impl Send for VirtualList
impl Sync for VirtualList
impl Unpin for VirtualList
impl UnsafeUnpin 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