Expand description
Virtualization primitives for efficient rendering of large content.
This module provides the foundational types for rendering only visible portions of large datasets, enabling smooth performance with 100K+ items.
§Core Types
Virtualized<T>- Generic container with visible range calculationVirtualizedStorage- Owned vs external storage abstractionItemHeight- Fixed vs variable height supportHeightCache- LRU cache for measured item heights
§Example
ⓘ
use ftui_widgets::virtualized::{Virtualized, ItemHeight};
// Create with owned storage
let mut virt: Virtualized<String> = Virtualized::new(10_000);
// Add items
for i in 0..1000 {
virt.push(format!("Line {}", i));
}
// Get visible range for viewport height
let range = virt.visible_range(24);
println!("Visible: {}..{}", range.start, range.end);Structs§
- Height
Cache - LRU cache for measured item heights.
- Variable
Heights Fenwick - Variable height tracker using Fenwick tree for O(log n) prefix sum queries.
- Virtualized
- A virtualized content container that tracks scroll state and computes visible ranges.
- Virtualized
List - A virtualized list widget that renders only visible items.
- Virtualized
List Persist State - Persistable state for a
VirtualizedListState. - Virtualized
List State - State for the VirtualizedList widget.
Enums§
- Item
Height - Height calculation strategy for items.
- Virtualized
Storage - Storage strategy for virtualized items.
Traits§
- Render
Item - Trait for items that can render themselves.