Skip to main content

Crate oxiui_table

Crate oxiui_table 

Source
Expand description

oxiui-table — Virtualized table widget for OxiUI.

Provides a Table<S> widget backed by a RowSource trait, with viewport-based virtualization: only rows visible in the current scroll window (plus a small overscan) are materialized per frame. This keeps memory and CPU usage constant regardless of the total row count.

§Features

  • egui-table — egui ScrollArea::show_rows rendering backend.
  • iced-table — iced scrollable + windowed column rendering backend.

§Example

use oxiui_table::{Table, RowSource, Cell, ColumnDef};

struct MyData;

impl RowSource for MyData {
    fn row_count(&self) -> usize { 1000 }
    fn row(&self, i: usize) -> Vec<Cell> {
        vec![Cell::Int(i as i64), Cell::Text(format!("row-{i}"))]
    }
    fn column_defs(&self) -> &[ColumnDef] {
        &[]
    }
}

let table = Table::new(MyData).with_row_height(24.0);
let visible = table.materialize_visible(240.0, 0.0);
assert!(visible.len() <= 20);

Re-exports§

pub use async_source::AsyncRowSource;
pub use async_source::BoxFuture;
pub use async_source::PrefetchBuffer;
pub use clipboard::selection_to_tsv;
pub use clipboard::CaptureClipboard;
pub use clipboard::ClipboardSink;
pub use clipboard::NullClipboard;
pub use format::CellFormatter;
pub use format::DateFormatter;
pub use format::DefaultFormatter;
pub use format::NumberFormatter;
pub use header::handle_row_click;
pub use header::move_column;
pub use header::HeaderSortState;
pub use header::TableIndex;
pub use height::CumulativeHeights;
pub use height_cache::CumulativeHeightCache;
pub use height_cache::RowCache;
pub use nav::TableNav;
pub use pagination::PaginationState;

Modules§

accessibility
oxiui-accessibility integration for oxiui-table.
async_source
Async data source support for OxiUI table.
clipboard
Clipboard integration for the table widget.
format
Cell formatting: convert a Cell to a display string with configurable number formatting, date formatting, or a custom closure.
header
Header-level UI state: sort indicator, column reordering, and memoised index computation.
height
Prefix-sum cache for variable-height row scroll lookup.
height_cache
Prefix-sum cumulative height cache with O(log n) binary search for row-by-offset lookup. Row caching: bounded LRU cache for last-N materialized rows.
nav
Keyboard navigation state for the table widget.
pagination
Pagination state: page-size, current page, and row-range computation.
persistence
COOLJAPAN ecosystem integration — table state persistence via oxicode.
text_integration
oxiui-text integration for oxiui-table.
theme_integration
oxiui-theme integration for oxiui-table.

Structs§

ColumnDef
Column definition: name, preferred display width, and optional per-column configuration.
ColumnDefBuilder
Fluent builder for ColumnDef.
ColumnFilter
A case-insensitive substring filter applied to a single column.
RenderedCell
A single positioned header cell produced by Table::render_header.
SelectionModel
Tracks the set of selected row indices and an anchor for range selection.
SortState
The active sort: which column and in which direction.
Table
A virtualized table widget backed by a RowSource.
TableBuilder
Fluent builder for creating a Table with a concrete data source.

Enums§

Cell
A single table cell value.
CellAlign
Horizontal alignment of a cell’s content within its column.
SelectionMode
The selection mode of a table.
SortDirection
The sort direction for a column.
TableError
Errors returned by RowSource mutating operations.
TableEvent
Events emitted by the table widget in response to user interaction.

Constants§

DEFAULT_ROW_HEIGHT
The default row height in logical pixels, used by RowSource::row_height when no per-row override is provided.

Traits§

CellRenderer
Trait for custom cell rendering.
RowSource
Trait that provides rows to the table widget.

Functions§

aggregate_avg
Compute the arithmetic average of all numeric cells in cells.
aggregate_count
Count non-empty cells in cells. Cell::Empty cells are excluded.
aggregate_sum
Sum all numeric cells in cells, treating Cell::Int and Cell::Float as f64. Non-numeric and Cell::Empty cells are skipped.
apply_all
Combine multiple ColumnFilters with AND semantics, returning matching row indices. A row matches only if it satisfies every active filter.
filter_indices
Compute the indices of rows in source for which predicate returns true.
sort_indices
Compute the row-index permutation that sorts source by a single column.
to_csv
Serialize source to a CSV string.