Skip to main content

Module virtualized

Module virtualized 

Source
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

§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§

HeightCache
LRU cache for measured item heights.
VariableHeightsFenwick
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.
VirtualizedList
A virtualized list widget that renders only visible items.
VirtualizedListPersistState
Persistable state for a VirtualizedListState.
VirtualizedListState
State for the VirtualizedList widget.

Enums§

ItemHeight
Height calculation strategy for items.
VirtualizedStorage
Storage strategy for virtualized items.

Traits§

RenderItem
Trait for items that can render themselves.