Skip to main content

Crate tui_treelistview

Crate tui_treelistview 

Source
Expand description

An interactive, model-agnostic Ratatui tree table.

TreeModel borrows a rooted acyclic graph from application-owned data, TreeQuery describes filtering and sorting, and TreeListViewState owns stable UI state plus the derived TreeProjection cache. TreeListView uses that same projection for viewport-only rendering, ensuring input and display always agree.

The model API supports stable generic IDs, multiple roots, asynchronous child states, and explicit revisions. The view adds typed actions and intents, validated dynamic columns, two-dimensional scrolling, tri-state marks, snapshots, and hit testing.

Feature flags:

  • keymap: crossterm-based key bindings and TreeListViewState::handle_key* helpers.
  • serde: serde support for TreeListViewSnapshot.

Modules§

prelude

Structs§

ColumnDef
A column definition. Exactly one column in a set must have the tree role.
ColumnWidth
A validated width range satisfying min <= ideal <= max.
IndexedTree
A validated zero-copy adapter over an indexed adjacency list.
NoFilter
A filter that matches every node.
NoSort
No sorting; preserves model order.
ProjectedNode
A node in the flat visible tree projection.
TreeChangeSet
The exact model changes needed to reconcile widget state.
TreeColumnSet
A dynamic column set parsed and validated once at construction.
TreeGlyphs
Glyphs for tree structure and lazy-loading states.
TreeLabelPrefix
A node name with an optional leading icon.
TreeListView
A stateful tree table built around one projection shared by rendering and navigation.
TreeListViewSnapshot
The serializable persistent part of view state.
TreeListViewState
Persistent view state and its derived caches.
TreeListViewStyle
Visual tree configuration.
TreeModelRef
A zero-copy adapter over roots and a child accessor for arbitrary storage.
TreeProjection
A cached flat projection shared by navigation and rendering.
TreeQuery
A complete query for building the visible projection.
TreeRevision
A monotonically increasing revision of model, filter, or sorting data.
TreeRowContext
Context for rendering one tree row.
TreeRowNodeState
Node state available to row renderers.
TreeRowRenderState
View state available to row renderers.

Enums§

ColumnWidthError
An error produced while constructing a valid column width.
IndexedTreeError
An error produced while parsing an indexed tree.
TreeAction
An action produced by the application or user.
TreeChildren
The state of a node’s child list.
TreeColumnsError
An error produced while parsing a column set.
TreeEditAction
High-level editing actions for the selected node.
TreeEditCommand
An atomic model editing command.
TreeEditRequest
A typed edit request enriched with the current selection.
TreeEvent
The result of handling an action.
TreeExpansionState
A node’s effective expansion state in the current projection.
TreeFilterConfig
Tree filtering configuration.
TreeHit
A hit-test result for the most recently rendered layout.
TreeHitRegion
The region of the latest rendering that contains a coordinate.
TreeHorizontalScroll
Horizontal layout policy.
TreeInsertPosition
An insertion position within a child list.
TreeIntent
An intent that must be handled by the application.
TreeMarkState
A node’s aggregated mark state.
TreeMatchState
A node’s role in a filtered projection.
TreeRootVisibility
Controls how roots are projected.
TreeRowRendering
Strategy for building table rows.
TreeScrollPolicy
Policy for keeping the selection in the vertical viewport.
TreeSelectionFallback
Selection policy used when the selected node disappears from the projection.
TreeSelectionUpdate
A selection update after a successful edit.
TreeViewAction
Actions that only change view state.

Traits§

TreeCellRenderer
Renders an additional cell with full row context.
TreeColumns
Lays out columns and builds every cell in a row.
TreeEditor
Applies typed editing commands to a domain model.
TreeFilter
A node visibility filter.
TreeLabelProvider
A simplified provider for node names and icons.
TreeLabelRenderer
A complete renderer for the primary tree cell.
TreeModel
Минимальный контракт источника дерева, леса или корневого ациклического графа.
TreeSort
A policy for sorting sibling nodes.

Functions§

distribute_widths
Distributes width as evenly as possible between min, ideal, and max.
tree_label_line
Builds the primary cell contents, including guides and branch state.
tree_name_cell
Wraps tree_label_line in a table cell.