Skip to main content

teksilo_data/
lib.rs

1// SPDX-License-Identifier: MPL-2.0
2// SPDX-FileCopyrightText: 2026 FernTech
3
4//! Data model abstractions for Teksilo.
5//!
6//! Provides reactive collection types (`ListModel<T>`, `TreeModel<T>`) and
7//! change notification enums (`DataChange`, `TreeChange`) for data-driven
8//! widgets like `ListView`, `TreeView`, and `Repeater`.
9//!
10//! The two source traits — [`ListDataSource`] (flat) and [`TreeDataSource`]
11//! (hierarchical) — are the read-and-command interfaces every data view talks
12//! to. `ListModel` / `TreeModel` are built-in implementations; an external
13//! source of truth (e.g. a Qleany entity store) implements a source trait
14//! directly and so never mirrors itself into a built-in model. Each trait
15//! carries a capability protocol — identity (`key_at`/`index_of`), DnD
16//! validation (`drag`/`can_accept`/`accept_drop`/`on_drag_out`), and lazy
17//! loading (`row_state`/`request_window`/`can_fetch_more`/`fetch_more`) — as
18//! defaulted methods (see [`dnd_types`]).
19//!
20//! Chart data follows the same shape: [`ChartModel<T>`] is the reactive,
21//! multi-series primary model (mirroring `ListModel`/`TreeModel`), with
22//! [`ChartWindow<T>`] / [`ChartAggregate<T>`] streaming/rollup projections
23//! and [`ChartSelection`] for point-level selection.
24#![allow(clippy::type_complexity)]
25
26pub mod chart_aggregate;
27pub mod chart_change;
28pub mod chart_model;
29pub mod chart_selection;
30pub mod chart_window;
31pub mod check_state;
32pub mod checked_model;
33pub mod data_change;
34#[cfg(debug_assertions)]
35pub mod debug_registry;
36pub mod dnd_types;
37pub mod keyed_selection_model;
38pub mod keyed_tree_checked_model;
39pub mod list_data_source;
40pub mod list_model;
41pub mod selection_model;
42pub mod series_pattern;
43pub mod sort_filter_list_model;
44pub mod sort_filter_tree_model;
45pub mod tree_change;
46pub mod tree_checked_model;
47pub mod tree_data_slice;
48pub mod tree_data_source;
49pub mod tree_model;
50pub mod tree_row_filter;
51pub mod tree_slice;
52
53pub use chart_aggregate::{ChartAggregate, ChartAggregateFn};
54pub use chart_change::{ChartChange, SeriesId};
55pub use chart_model::{ChartDatum, ChartModel, ChartSeries, SeriesView};
56pub use chart_selection::ChartSelection;
57pub use chart_window::ChartWindow;
58pub use check_state::CheckState;
59pub use checked_model::CheckedModel;
60pub use data_change::{DataChange, map_index_after_move};
61pub use dnd_types::{
62    DragEligibility, DragSource, DropCommit, DropPosition, DropQuery, DropResponse, ItemKey,
63    RowState,
64};
65pub use keyed_selection_model::KeyedSelectionModel;
66pub use keyed_tree_checked_model::KeyedTreeCheckedModel;
67pub use list_data_source::ListDataSource;
68pub use list_model::ListModel;
69pub use selection_model::{SelectionMode, SelectionModel};
70pub use series_pattern::{SeriesHatch, SeriesMarker, SeriesPattern};
71pub use sort_filter_list_model::{SortDirection, SortFilterListModel};
72pub use sort_filter_tree_model::{SortFilterTreeModel, TreeFilterMode};
73pub use tree_change::{NodeId, TreeChange};
74pub use tree_checked_model::{AggregateMode, TreeCheckedModel};
75pub use tree_data_slice::{TreeDataSlice, TreeRow};
76pub use tree_data_source::{FlatEntry, TreeDataSource};
77pub use tree_model::TreeModel;
78pub use tree_row_filter::TreeRowFilter;
79pub use tree_slice::{TreeSlice, TreeSliceHandle};