pub struct DataTableState {
pub table_state: TableState,
pub visible_rows: usize,
pub termcol_index: usize,
pub visible_termcols: usize,
pub suppress_error_display: bool,
pub needs_recollect: bool,
/* private fields */
}Fields§
§table_state: TableState§visible_rows: usize§termcol_index: usize§visible_termcols: usize§suppress_error_display: bool§needs_recollect: boolSet by the render code when visible_rows changes. The App event loop checks this
after each render and triggers an async collect if needed.
Implementations§
Source§impl DataTableState
impl DataTableState
pub fn new( lf: LazyFrame, pages_lookahead: Option<usize>, pages_lookback: Option<usize>, max_buffered_rows: Option<usize>, max_buffered_mb: Option<usize>, polars_streaming: bool, ) -> Result<Self>
Sourcepub fn from_lazyframe(lf: LazyFrame, options: &OpenOptions) -> Result<Self>
pub fn from_lazyframe(lf: LazyFrame, options: &OpenOptions) -> Result<Self>
Create state from an existing LazyFrame (e.g. from Python or in-memory). Uses OpenOptions for display/buffer settings.
Sourcepub fn from_schema_and_lazyframe(
schema: Arc<Schema>,
lf: LazyFrame,
options: &OpenOptions,
partition_columns: Option<Vec<String>>,
) -> Result<Self>
pub fn from_schema_and_lazyframe( schema: Arc<Schema>, lf: LazyFrame, options: &OpenOptions, partition_columns: Option<Vec<String>>, ) -> Result<Self>
Create state from a pre-collected schema and LazyFrame (for phased loading). Does not call collect_schema();
df is None so the UI can render headers while the first collect() runs.
When partition_columns is Some (e.g. hive), column order is partition cols first.
Sourcepub fn with_open(self, facts: OpenFacts) -> Self
pub fn with_open(self, facts: OpenFacts) -> Self
The state as its open found the dataset: everything in facts, given at once.
The one way an open’s findings reach a state, taken while it is still the data as
loaded. Applied in the order they depend on each other: the files before their row
groups, which set the count. Once on screen, a dataset learns more only through
Self::join_dataset_schema and Self::count_landed.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Back to the table as opened: the data as loaded, nothing applied, and every column’s width learned afresh from the first page.
pub fn from_parquet(path: &Path, options: &OpenOptions) -> Result<Self>
pub fn from_parquet_paths( paths: &[impl AsRef<Path>], options: &OpenOptions, ) -> Result<Self>
Sourcepub fn from_ipc(path: &Path, options: &OpenOptions) -> Result<Self>
pub fn from_ipc(path: &Path, options: &OpenOptions) -> Result<Self>
Load a single Arrow IPC / Feather v2 file (lazy).
Sourcepub fn from_ipc_paths(
paths: &[impl AsRef<Path>],
options: &OpenOptions,
) -> Result<Self>
pub fn from_ipc_paths( paths: &[impl AsRef<Path>], options: &OpenOptions, ) -> Result<Self>
Load multiple Arrow IPC / Feather files and concatenate into one LazyFrame.
Sourcepub fn from_avro(path: &Path, options: &OpenOptions) -> Result<Self>
pub fn from_avro(path: &Path, options: &OpenOptions) -> Result<Self>
Load a single Avro file (eager read, then lazy).
Sourcepub fn from_avro_paths(
paths: &[impl AsRef<Path>],
options: &OpenOptions,
) -> Result<Self>
pub fn from_avro_paths( paths: &[impl AsRef<Path>], options: &OpenOptions, ) -> Result<Self>
Load multiple Avro files and concatenate into one LazyFrame.
Sourcepub fn from_excel(path: &Path, options: &OpenOptions) -> Result<Self>
pub fn from_excel(path: &Path, options: &OpenOptions) -> Result<Self>
Load a single Excel file (xls, xlsx, xlsm, xlsb) using calamine (eager read, then lazy).
Sheet is selected by name, or by 0-based index when no sheet is so named, via
options.table (--table).
Sourcepub fn from_orc(path: &Path, options: &OpenOptions) -> Result<Self>
pub fn from_orc(path: &Path, options: &OpenOptions) -> Result<Self>
Load a single ORC file (eager read via orc-rust → Arrow, then convert to Polars, then lazy).
ORC is read fully into memory; see docs/formats/columnar-and-json.md.
Sourcepub fn from_orc_paths(
paths: &[impl AsRef<Path>],
options: &OpenOptions,
) -> Result<Self>
pub fn from_orc_paths( paths: &[impl AsRef<Path>], options: &OpenOptions, ) -> Result<Self>
Load multiple ORC files and concatenate into one LazyFrame.
Sourcepub fn scan_parquet_hive(path: &Path) -> Result<LazyFrame>
pub fn scan_parquet_hive(path: &Path) -> Result<LazyFrame>
Build a LazyFrame for hive-partitioned Parquet only (no schema collection, no partition discovery). Use this for phased loading so “Scanning input” is instant; schema and partition handling are the schema phase’s.
Sourcepub fn scan_parquet_hive_with_schema(
path: &Path,
schema: Arc<Schema>,
) -> Result<LazyFrame>
pub fn scan_parquet_hive_with_schema( path: &Path, schema: Arc<Schema>, ) -> Result<LazyFrame>
Build a LazyFrame for hive-partitioned Parquet with a pre-computed schema (avoids slow collect_schema across all files).
Sourcepub fn schema_from_one_hive_parquet(
path: &Path,
) -> Result<(Arc<Schema>, Vec<String>)>
pub fn schema_from_one_hive_parquet( path: &Path, ) -> Result<(Arc<Schema>, Vec<String>)>
Infer schema from one parquet file in a hive directory and merge with partition columns. Returns (merged_schema, partition_columns). Use with scan_parquet_hive_with_schema to avoid slow collect_schema(). Only supported when path is a directory (not a glob). Returns Err if no parquet file found or read fails.
Sourcepub fn discover_hive_partition_columns(path: &Path) -> Vec<String>
pub fn discover_hive_partition_columns(path: &Path) -> Vec<String>
Discover hive partition column names (public for phased loading). Directory: single-spine walk; glob: parse pattern.
Sourcepub fn from_parquet_hive(
path: &Path,
pages_lookahead: Option<usize>,
pages_lookback: Option<usize>,
max_buffered_rows: Option<usize>,
max_buffered_mb: Option<usize>,
row_numbers: bool,
row_start_index: usize,
) -> Result<Self>
pub fn from_parquet_hive( path: &Path, pages_lookahead: Option<usize>, pages_lookback: Option<usize>, max_buffered_rows: Option<usize>, max_buffered_mb: Option<usize>, row_numbers: bool, row_start_index: usize, ) -> Result<Self>
Load Parquet with Hive partitioning from a directory or glob path.
When path is a directory, partition columns are discovered from path structure.
When path contains glob (e.g. **/*.parquet), partition columns are inferred from the pattern (e.g. year=*/month=*).
Partition columns are moved to the left in the initial LazyFrame before state is created.
Performance: The slow part is Polars, not our code. scan_parquet + collect_schema() trigger
path expansion (full directory tree or glob) and parquet metadata reads; we only do a single-spine
walk for partition key discovery and cheap schema/select work.
pub fn set_row_numbers(&mut self, enabled: bool)
Sourcepub fn toggle_row_numbers(&mut self) -> bool
pub fn toggle_row_numbers(&mut self) -> bool
# on or off. Returns whether the view’s frame changed and its rows need
reading again: a sorted or filtered view of data with no place of its own
numbers its rows once # is on.
Sourcepub fn row_numbers(&self) -> bool
pub fn row_numbers(&self) -> bool
Whether the row-number column is shown.
Sourcepub fn row_start_index(&self) -> usize
pub fn row_start_index(&self) -> usize
Row number display start (0 or 1); used by go-to-line to interpret user input.
pub fn from_csv(path: &Path, options: &OpenOptions) -> Result<Self>
Sourcepub fn from_delimited(
path: &Path,
delimiter: u8,
options: &OpenOptions,
) -> Result<Self>
pub fn from_delimited( path: &Path, delimiter: u8, options: &OpenOptions, ) -> Result<Self>
A delimited text file, split on delimiter (its format’s separator) unless
--delimiter says otherwise. CSV, TSV and PSV are one reader, so every CSV
option means the same thing for all three.
pub fn from_csv_customize<F>( path: &Path, pages_lookahead: Option<usize>, pages_lookback: Option<usize>, max_buffered_rows: Option<usize>, max_buffered_mb: Option<usize>, func: F, ) -> Result<Self>
Sourcepub fn from_csv_paths(
paths: &[impl AsRef<Path>],
options: &OpenOptions,
) -> Result<Self>
pub fn from_csv_paths( paths: &[impl AsRef<Path>], options: &OpenOptions, ) -> Result<Self>
Load multiple CSV files (uncompressed) and concatenate into one LazyFrame.
pub fn from_json(path: &Path, options: &OpenOptions) -> Result<Self>
pub fn from_json_lines(path: &Path, options: &OpenOptions) -> Result<Self>
Sourcepub fn from_json_paths(
paths: &[impl AsRef<Path>],
options: &OpenOptions,
) -> Result<Self>
pub fn from_json_paths( paths: &[impl AsRef<Path>], options: &OpenOptions, ) -> Result<Self>
Load multiple JSON (array) files and concatenate into one LazyFrame.
Sourcepub fn from_json_lines_paths(
paths: &[impl AsRef<Path>],
options: &OpenOptions,
) -> Result<Self>
pub fn from_json_lines_paths( paths: &[impl AsRef<Path>], options: &OpenOptions, ) -> Result<Self>
Load multiple JSON Lines files and concatenate into one LazyFrame.
Sourcepub fn scroll_would_trigger_collect(&self, rows: i64) -> bool
pub fn scroll_would_trigger_collect(&self, rows: i64) -> bool
Returns true if a scroll by rows would trigger a collect (view would leave the buffer).
Used so the UI only shows the throbber when actual data loading will occur.
Sourcepub fn slide_table(&mut self, rows: i64) -> bool
pub fn slide_table(&mut self, rows: i64) -> bool
Update scroll position. If the view is within the buffer, re-slices display. If outside the buffer, sets the position but the caller must trigger a collect (synchronous or async) to load the new buffer range. Returns true if a collect is needed (view is outside the current buffer).
pub fn collect(&mut self)
pub fn prepare_async_collect( &mut self, num_rows_override: Option<usize>, ) -> Option<CollectRequest>
Sourcepub fn apply_async_collect(&mut self, result: CollectResult)
pub fn apply_async_collect(&mut self, result: CollectResult)
Apply the result of a background buffer load. The worker has already stitched
and cut it (FillPlan::fit): installing it copies nothing.
Sourcepub fn unsampled(&self) -> &DataTableState
pub fn unsampled(&self) -> &DataTableState
The view the sample was drawn from, or this one when it has none: where a new sample is drawn from.
Sourcepub fn analysis_lf(&self) -> LazyFrame
pub fn analysis_lf(&self) -> LazyFrame
Whether the frame on screen still grows from the dataset’s own scan.
A filter and a sort do: apply_transformations rebuilds them over whatever the
root is, so widening the root under them is exactly what should happen. A query,
a SQL statement, a fuzzy search, a pivot, a melt and a drill-down do not — each
makes its own result the root, with its own columns, and replacing the root
underneath one leaves the view naming columns the frame no longer has.
grouped and drilled_down_group_index are set together by a drill down and
cleared together by a drill up, so asking both is belt and braces — kept because
what they guard is the frame being rebuilt under a view of one group of it.
The frame an analysis reads: the view as filtered and queried, without its
order. No statistic depends on the order, and a sort is the one step that makes
a sampled read of a huge table read all of it.
Sourcepub fn preview_lf(&self) -> LazyFrame
pub fn preview_lf(&self) -> LazyFrame
What the Pivot & Melt builder previews a few rows of: the view as the user sees its columns, without its order. A sort would make the head of a large table a read of all of it.
Sourcepub fn is_sorted(&self) -> bool
pub fn is_sorted(&self) -> bool
Whether the view has a sort, which Self::preview_lf leaves out.
pub fn scan_is_the_root(&self) -> bool
Sourcepub fn measurements(&self) -> &Arc<Meter> ⓘ
pub fn measurements(&self) -> &Arc<Meter> ⓘ
What finding and reading this dataset cost.
Sourcepub fn parquet_count_dir(&self) -> Option<PathBuf>
pub fn parquet_count_dir(&self) -> Option<PathBuf>
The directory whose Parquet footers can be summed for an exact row count, if the
current lf still allows it. See parquet_count_dir.
Sourcepub fn len_generation(&self) -> u64
pub fn len_generation(&self) -> u64
Current count generation. A background len() task captures this; its result is
only applied if the generation still matches (i.e. the data hasn’t changed since).
Sourcepub fn num_rows_if_valid(&self) -> Option<usize>
pub fn num_rows_if_valid(&self) -> Option<usize>
Returns the cached row count when valid (same value shown in the control bar). Use this to avoid an extra full scan for analysis/describe when the table has already been collected.
Sourcepub fn is_num_rows_valid(&self) -> bool
pub fn is_num_rows_valid(&self) -> bool
True when num_rows reflects the current lf. Used by App to decide whether
to dispatch a background len() query before planning the buffer collect.
Sourcepub fn total_rows_when_subset(&self) -> Option<usize>
pub fn total_rows_when_subset(&self) -> Option<usize>
The dataset’s full row count for the control bar, when the rows on screen are a subset of it: a sidebar filter, a query in any bar or a drill-down is active and the count from before it was applied is known. A pivot or melt makes rows that are not the dataset’s, so the comparison would mislead and none is offered. Cheap by construction: it only reads what a pristine collect already knew.
Sourcepub fn lf_clone(&self) -> LazyFrame
pub fn lf_clone(&self) -> LazyFrame
Clone of the LazyFrame for off-thread queries (e.g. background len()).
Sourcepub fn polars_streaming_enabled(&self) -> bool
pub fn polars_streaming_enabled(&self) -> bool
Whether the current LazyFrame should use Polars streaming engine.
Sourcepub fn buffered_start(&self) -> usize
pub fn buffered_start(&self) -> usize
Start row of the currently buffered range.
Sourcepub fn buffered_end(&self) -> usize
pub fn buffered_end(&self) -> usize
End row (exclusive) of the currently buffered range.
Sourcepub fn is_remote_source(&self) -> bool
pub fn is_remote_source(&self) -> bool
True for a scan of an object store in place.
Polars fetches a Parquet row group whole for any slice that touches it and keeps
nothing between collects, so the small, proximity-driven refills that suit a
local file each download the same row group again: paging through one row group
cost a fetch of it every few pages. A remote buffer is planned as a single window
of max_buffered_rows around the view instead. Scrolling inside it costs
nothing; leaving it, or a jump, costs one fetch.
Sourcepub fn source_schema(&self) -> &Arc<Schema> ⓘ
pub fn source_schema(&self) -> &Arc<Schema> ⓘ
The schema of the data as loaded, before any query or reshape: what a view’s settings run on, and so what its schema rule records and matches.
The pass that is still reading this dataset’s footers, if one is.
Sourcepub fn counts_itself_later(&self) -> bool
pub fn counts_itself_later(&self) -> bool
Whether this frame’s row count is already on its way.
The frame matters: what the pass is bringing is the dataset’s count, which is not the count of a query’s result. Asking this about the wrong frame is how a count nobody else was going to take gets declined.
A staged open is still reading every footer, and those footers hold the count. Asking for it separately would read all of them a second time, so the dataset says it will have one shortly and the caller does not start a count of its own.
Sourcepub fn indexing(&self) -> Option<&Arc<Lines>>
pub fn indexing(&self) -> Option<&Arc<Lines>>
The lines being indexed behind the first rows, if they still are.
Sourcepub fn lines_to_index(&self) -> Option<&Arc<Lines>>
pub fn lines_to_index(&self) -> Option<&Arc<Lines>>
The lines this dataset opened from in part, until it has been told they are all in, though their indexing is paused: what an indexing thread works on.
Sourcepub fn row_estimate(&self, pass: Option<RowEstimate>) -> Option<RowEstimate>
pub fn row_estimate(&self, pass: Option<RowEstimate>) -> Option<RowEstimate>
The dataset’s row count from a sample of its footers, while the frame is the
dataset as loaded and its count is not known. pass is the estimate of the
footer pass still reading, which the dataset has not been given yet.
Sourcepub fn file_row_starts(&self) -> Option<Vec<usize>>
pub fn file_row_starts(&self) -> Option<Vec<usize>>
Where each of the dataset’s files starts in the view, with the total last: while the view keeps the dataset’s rows and every file’s rows are known.
Sourcepub fn files_to_count(&self) -> Option<usize>
pub fn files_to_count(&self) -> Option<usize>
How many files a count of the dataset reads footers of, when it reads them.
Sourcepub fn numbered_by_default(&self) -> bool
pub fn numbered_by_default(&self) -> bool
Whether # is on for this dataset when the config leaves it to the format:
text and logs, whose rows carry their place in the file.
Sourcepub fn row_numbers_count_the_view(&self) -> bool
pub fn row_numbers_count_the_view(&self) -> bool
Whether # is on and numbers the rows by their place in the view, because
the view’s rows do not carry their place in the source: a sorted or filtered
view of data in a store, of many files, or too large to number.
Give up on the rest of the footers: the pass could not read them.
The dataset stays as it opened — a working view of it, built from two footers — and stops waiting. That matters beyond the columns: while a pass is pending the dataset declines to count itself, because the pass was going to bring the count with it. One failed pass would otherwise cost it an exact row count, and its windowed reads, for the rest of the session.
Sourcepub fn join_dataset_schema(
&mut self,
found: FootersFound,
) -> Result<(), Box<FootersFound>>
pub fn join_dataset_schema( &mut self, found: FootersFound, ) -> Result<(), Box<FootersFound>>
Every footer’s answer, joined to the dataset already on screen.
The open painted from the first file and the newest; this is what the rest of them say. Columns only ever join: a name the opening schema did not have goes on the end, and every name already there keeps its place — including the places a user has since moved them to — so nothing moves under the cursor except to make room for what arrived.
The frame is rebuilt rather than widened in place, because the scan itself differs: it now knows which files hold a column in a type the dataset cannot keep, and with every file’s row count it can number the rows, which is what tells an absent cell from a null.
Gives them back as Err rather than taking them, while the user is looking at
something built on top of the scan instead of the scan itself — see
Self::scan_is_the_root. Rebuilding the root under a query takes away the
columns the query named; handing them back lets the caller keep them and offer
them again when the view comes back to the data.
Sourcepub fn visible_lf(&self) -> LazyFrame
pub fn visible_lf(&self) -> LazyFrame
The frame as the user sees it: lf without the hidden row-index column.
Everything that exports, reshapes, groups or analyses the data reads this. The
buffer reads lf itself and keeps the column, which is how display_drift
traces a row back to its file; it stays invisible because the display is only
ever a projection of column_order, which never names it.
Sourcepub fn scans_a_temp_file(&self) -> bool
pub fn scans_a_temp_file(&self) -> bool
Whether the frame scans a temporary file this state holds (a decompressed archive). A view captured at exit must not reference it: the file is removed when the last state holding it drops, and the plan would scan a path that no longer exists.
Sourcepub fn scans_a_download(&self) -> bool
pub fn scans_a_download(&self) -> bool
Whether the frame scans a downloaded remote file, removed when datui lets go of
it; see Self::scans_a_temp_file.
Sourcepub fn read_mode(&self) -> Option<ReadMode>
pub fn read_mode(&self) -> Option<ReadMode>
How the open reads the data, when an open found it; None for a frame handed
in whole, such as one from Python.
Sourcepub fn read_as(&self) -> Option<FileFormat>
pub fn read_as(&self) -> Option<FileFormat>
The format the open read the data as. See OpenFacts::read_as.
Sourcepub fn fetched(&self) -> bool
pub fn fetched(&self) -> bool
Whether the data was downloaded from a remote source before it was read.
Sourcepub fn query_source(&self) -> LazyFrame
pub fn query_source(&self) -> LazyFrame
The frame a query, a SQL statement or a fuzzy search builds on. Never carries the drift column: a query’s rows are its own, and its schema becomes the column order, so the column would otherwise become one of the data’s.
Sourcepub fn drift_groups(&self) -> Arc<Vec<DriftGroup>> ⓘ
pub fn drift_groups(&self) -> Arc<Vec<DriftGroup>> ⓘ
What each drift group is missing, for the renderer. Empty when nothing drifts.
Sourcepub fn can_name_source_files(&self) -> bool
pub fn can_name_source_files(&self) -> bool
Whether an export can name each row’s file: the frame has to still carry the scan’s row index, and the dataset has to have files to name.
Sourcepub fn export_frame(&self, name_files: bool) -> ExportFrame
pub fn export_frame(&self, name_files: bool) -> ExportFrame
The rows an export writes, planned and not run: the view, and when
name_files asks and the dataset can, a column naming each row’s file in
place of the scan’s hidden row index. Otherwise the index is dropped, so
datui’s own bookkeeping never lands in the user’s file.
Sourcepub fn dataset_notes(&self) -> &[Note]
pub fn dataset_notes(&self) -> &[Note]
What datui noticed about the dataset itself, as its footers were read.
Separate from Self::notes because this is the half that belongs to the
data: a snapshot taken to roll a view back has to put back these and not
the view’s, which describe a filter and sort that the rollback is undoing.
Sourcepub fn notes(&self) -> Vec<Note>
pub fn notes(&self) -> Vec<Note>
What datui noticed: about the dataset when it opened, then about the view the filter and sort have made of it. Empty when there is nothing to say.
Sourcepub fn not_the_table(&self) -> Option<&'static str>
pub fn not_the_table(&self) -> Option<&'static str>
The lake format whose plain files this dataset is, if it is one.
For the chip in the control bar. The note says the same at length; this is what keeps the row count from reading as the table’s.
Sourcepub fn other_tables(&self) -> &[String]
pub fn other_tables(&self) -> &[String]
The file’s other tables, as --table names them; empty for a file of one.
Sourcepub fn format_read(&self) -> Option<&Arc<Read>>
pub fn format_read(&self) -> Option<&Arc<Read>>
What a read through a format spec found, when the dataset was read through one.
Sourcepub fn delimited_read(&self) -> Option<&Arc<DelimitedRead>>
pub fn delimited_read(&self) -> Option<&Arc<DelimitedRead>>
What a read through a delimited spec found, when the dataset was read through one.
Sourcepub fn unit_of(&self, column: &str) -> Option<&str>
pub fn unit_of(&self, column: &str) -> Option<&str>
The unit of the column named column, from a delimited spec’s unit row or the
file itself. A filter, sort, drill or query that keeps the loaded column, renamed
or not, keeps its unit; a column a query computes has none, whatever it is called.
Sourcepub fn format_detail(&self) -> Option<&Detail>
pub fn format_detail(&self) -> Option<&Detail>
What the file said besides its rows: its Info panel tab.
Sourcepub fn has_notes(&self) -> bool
pub fn has_notes(&self) -> bool
Whether datui noticed anything at all. Answers what notes() is usually asked
— whether to offer the tab — without building the list to find out.
Sourcepub fn notes_unseen(&self) -> bool
pub fn notes_unseen(&self) -> bool
Whether there is something to say that has not been offered yet.
Sourcepub fn notes_seen(&self) -> bool
pub fn notes_seen(&self) -> bool
Whether the notes have been offered. Exact, where !notes_unseen() would also
be true of a dataset that has nothing to say.
Sourcepub fn mark_notes_seen(&mut self)
pub fn mark_notes_seen(&mut self)
The Info panel has been opened; the quiet accent has done its job.
Sourcepub fn read_column_as_text(&mut self, column: &str) -> PolarsResult<bool>
pub fn read_column_as_text(&mut self, column: &str) -> PolarsResult<bool>
Read column as text from every file, so the values a type conflict hid can be
seen.
Rebuilds the scan rather than re-opening the dataset: everything it needs is already here. The file list, each file’s row count and — since the footers were read — the type each file holds each conflicting column in are all on hand, so this costs no directory listing, no footer read and no request. The view goes with it: a filter and sort in force are re-applied to the new frame.
Returns whether anything happened. false for a column that is not on offer,
which is what the panel only ever asks about, and for one already read this way.
A scan that cannot be built is kept as the error showing, and returned.
Sourcepub fn read_as_text(&self) -> &[PlSmallStr]
pub fn read_as_text(&self) -> &[PlSmallStr]
The columns being read as text rather than as the type most rows have.
Sourcepub fn dataset_schema(&self) -> Option<&DatasetSchema>
pub fn dataset_schema(&self) -> Option<&DatasetSchema>
What the footers said about the dataset’s columns, when it is many files.
Sourcepub fn remote_files_counter(&self) -> Option<FileCounter>
pub fn remote_files_counter(&self) -> Option<FileCounter>
The counter for a remote dataset’s files, while its count would be the data’s: the frame is the scan as loaded, and the files have not been counted yet.
Not while a pass is already reading every footer of this dataset. That pass brings the row groups back with it, and this counter reads the same footers a second time — for a prefix of 6,541 files, 6,541 ranged reads to learn what is already on its way. Staging the open to save round trips and then spending them here would be worse than not staging it at all.
Sourcepub fn files_a_page_reads(&self, start: usize, len: usize) -> Option<usize>
pub fn files_a_page_reads(&self, start: usize, len: usize) -> Option<usize>
The frame for buffer rows [start, start + len), columns in display order. For a
remote dataset whose files are counted, a scan of only the files holding them.
How many of the dataset’s files a page at start would read.
A windowed remote scan reads only the files holding those rows; everything else
hands the whole scan to Polars, which reads what it decides to and does not say.
None is that second case — not zero, which would claim a page came from
nowhere.
Sourcepub fn carries_source_rows(&self) -> bool
pub fn carries_source_rows(&self) -> bool
Whether the frame’s rows carry their place in the source, for #: a dataset’s
rows that know their file, or lines, while the frame is still the scan’s. A
query’s rows, a reshape’s and a group’s stand for no row of the source.
Sourcepub fn row_numbers_from(&self, start: usize, rows: usize) -> Vec<usize>
pub fn row_numbers_from(&self, start: usize, rows: usize) -> Vec<usize>
What # shows for rows rows from start: each row’s place in the source
where the rows carry it, else its place in the view, counted from
row_start_index. A pristine view’s places are the source’s either way.
Sourcepub fn estimated_row_bytes(&self) -> usize
pub fn estimated_row_bytes(&self) -> usize
Best available in-memory width estimate for one logical row.
Data Quality uses this only for a preflight estimate and labels the result as approximate. Buffer planning uses the same source so the two surfaces do not disagree about the shape of the current view.
Sourcepub fn source_file_count(&self) -> Option<usize>
pub fn source_file_count(&self) -> Option<usize>
Number of source files known to participate in the pristine dataset scan.
Returns None after a query or reshape has broken the row-to-file mapping.
Sourcepub fn at_end(&self) -> bool
pub fn at_end(&self) -> bool
True when the view already shows the last page, so End has nothing to load.
Sourcepub fn wants_to_load_ahead(&self) -> bool
pub fn wants_to_load_ahead(&self) -> bool
Whether the view is inside the buffer and within a page of one of its ends, with more data past that end: where a collect would grow the buffer, if one ran. A scroll that stays inside the buffer runs none, so the growing waited until the view had left it — and the page was blank while it happened.
Sourcepub fn buffer_position(&self) -> (u64, usize, usize, usize)
pub fn buffer_position(&self) -> (u64, usize, usize, usize)
Where the view and the buffer are, to tell one load-ahead attempt from the next.
Sourcepub fn select_next(&mut self) -> bool
pub fn select_next(&mut self) -> bool
Returns true if a buffer collect is needed after the scroll.
Sourcepub fn page_down(&mut self) -> bool
pub fn page_down(&mut self) -> bool
Returns true if a buffer collect is needed after the scroll.
Sourcepub fn select_previous(&mut self) -> bool
pub fn select_previous(&mut self) -> bool
Returns true if a buffer collect is needed after the scroll.
Sourcepub fn scroll_to_row_centered(&mut self, row_index: usize) -> bool
pub fn scroll_to_row_centered(&mut self, row_index: usize) -> bool
Set scroll position for go-to-line (centered). Returns true if a collect is needed.
Sourcepub fn scroll_to_start(&mut self) -> bool
pub fn scroll_to_start(&mut self) -> bool
Jump to the first page. Returns true if a collect is needed.
Sourcepub fn scroll_to_end(&mut self) -> bool
pub fn scroll_to_end(&mut self) -> bool
Jump to the last page. Returns true if a collect is needed.
Sourcepub fn half_page_down(&mut self) -> bool
pub fn half_page_down(&mut self) -> bool
Returns true if a buffer collect is needed after the scroll.
Sourcepub fn half_page_up(&mut self) -> bool
pub fn half_page_up(&mut self) -> bool
Returns true if a buffer collect is needed after the scroll.
pub fn scroll_right(&mut self)
pub fn scroll_left(&mut self)
Sourcepub fn columns_on_screen(&self) -> Option<OnScreen>
pub fn columns_on_screen(&self) -> Option<OnScreen>
Which shown columns the table last drew, and the cursor’s: what the control bar’s column position says.
Sourcepub fn scroll_columns(&mut self, mv: ColumnMove)
pub fn scroll_columns(&mut self, mv: ColumnMove)
Move the view sideways, leaving the cursor where it is unless the view leaves it behind on the left. Planned from the widths the columns were last drawn at; reads nothing. A page that needs a column not drawn yet waits for the next draw, which measures it from the rows on hand; a relative move typed behind it waits too and lands after it, in order, so no key is lost or planned on a guess.
Sourcepub fn move_cursor(&mut self, mv: CursorMove)
pub fn move_cursor(&mut self, mv: CursorMove)
Move the column cursor (h l [ ] { }), the view following only when
the cursor would leave the screen. Reads nothing; a move that needs a column
not drawn yet waits for the next draw, in order, as Self::scroll_columns
says.
Sourcepub fn go_to_column(&mut self, name: &str)
pub fn go_to_column(&mut self, name: &str)
Put the cursor on the shown column name and show it as g does: left where
it is when already whole on screen, else first after the frozen columns, or on
the last page when it is there. A frozen column is on screen already.
Sourcepub fn set_current_column(&mut self, name: &str)
pub fn set_current_column(&mut self, name: &str)
Put the cursor on the shown column name, scrolling as little as it takes to
show it.
Sourcepub fn current_column(&self) -> Option<&str>
pub fn current_column(&self) -> Option<&str>
The column cursor’s column: the one the per-column keys act on (value counts,
copying a cell, the sidebar and inspector opening on it, a find in one column).
The first shown column until the cursor moves; None with no columns shown.
Sourcepub fn current_column_index(&self) -> Option<usize>
pub fn current_column_index(&self) -> Option<usize>
The cursor’s place among the shown columns, from 0, frozen ones first.
pub fn headers(&self) -> Vec<String>
pub fn set_column_order(&mut self, order: Vec<String>)
pub fn set_locked_columns(&mut self, count: usize)
pub fn locked_columns_count(&self) -> usize
Sourcepub fn frozen_shown(&self) -> usize
pub fn frozen_shown(&self) -> usize
How many columns are drawn frozen: the count asked for, or fewer while the last layout could not fit them all beside a usable scrolling column. The ones left out lead the scrolling columns, so every column stays reachable.
Sourcepub fn width_choice(&self, name: &str) -> WidthChoice
pub fn width_choice(&self, name: &str) -> WidthChoice
How a column’s width is chosen.
Sourcepub fn shown_width(&self, name: &str) -> Option<u16>
pub fn shown_width(&self, name: &str) -> Option<u16>
The width a column was last drawn at, if it has been drawn.
Sourcepub fn on_screen_width(&self, name: &str) -> Option<u16>
pub fn on_screen_width(&self, name: &str) -> Option<u16>
The width the column takes on screen, the room it filled at the right edge included.
Sourcepub fn set_width_choices(
&mut self,
choices: impl IntoIterator<Item = (String, WidthChoice)>,
)
pub fn set_width_choices( &mut self, choices: impl IntoIterator<Item = (String, WidthChoice)>, )
Set how each named column’s width is chosen. Reads nothing: a fit is taken from the rows on screen when the table is next drawn.
Sourcepub fn get_filters(&self) -> &[FilterStatement]
pub fn get_filters(&self) -> &[FilterStatement]
Filters for a view: while drilled into a group these are the grouped view’s, which is what a view reproduces (it cannot express a drill-down).
pub fn get_sort_columns(&self) -> &[String]
pub fn get_sort_ascending(&self) -> bool
pub fn get_sort_descending(&self) -> &[bool]
Sourcepub fn view_filters(&self) -> &[FilterStatement]
pub fn view_filters(&self) -> &[FilterStatement]
Filters applied to the frame on screen (inside the group while drilled). This is what the Sort & Filter sidebar shows and edits.
pub fn view_sort_columns(&self) -> &[String]
pub fn view_sort_ascending(&self) -> bool
pub fn view_sort_descending(&self) -> &[bool]
Sourcepub fn header_sort(&self) -> (Vec<String>, Vec<bool>)
pub fn header_sort(&self) -> (Vec<String>, Vec<bool>)
The header’s sort marks: the sidebar’s sort, or else the ORDER BY of the SQL in effect, while its own rows are on screen (not a group drilled into).
Sourcepub fn reshaped_lf_clone(&self) -> Option<LazyFrame>
pub fn reshaped_lf_clone(&self) -> Option<LazyFrame>
The pivot/melt result in effect, for a snapshot that may need to put it back.
pub fn get_column_order(&self) -> &[String]
Sourcepub fn is_at_defaults(&self) -> bool
pub fn is_at_defaults(&self) -> bool
Whether the table shows its defaults: no query, filters, sort or reshape, every column in file order, nothing locked. A view saved from this state would carry nothing — and, matching by schema, it would shadow real views in the apply gate as a well-used no-op.
pub fn get_active_query(&self) -> &str
pub fn get_active_sql_query(&self) -> &str
Sourcepub fn check_plan(&self) -> PolarsResult<()>
pub fn check_plan(&self) -> PolarsResult<()>
Whether the rows on screen can be read at all: a sort, a filter or a column named in the layout that the frame does not have fails here. Resolves the plan and reads no rows.
Sourcepub fn rollback_point(&self) -> ViewRollback
pub fn rollback_point(&self) -> ViewRollback
The view as it is now, to go back to if a query fails while running.
Sourcepub fn roll_back(&mut self, saved: ViewRollback)
pub fn roll_back(&mut self, saved: ViewRollback)
Put back the view rollback_point saved, with no error showing. Its row count
and buffer come back with it, and a count of it that landed meanwhile (see
ViewRollback::count_landed), so nothing is read again. Nothing is read here:
a view with no rows on hand has them read by the caller’s next collect.
A checkpoint taken over data since replaced — a join of the remaining footers, a column read as text — holds frames built on data no longer loaded. Putting those back would mix two roots, so the view returns to the data as loaded instead.
Sourcepub fn try_transition<T, E>(
&mut self,
steps: impl FnOnce(&mut Self) -> Result<T, E>,
) -> Result<(T, ViewRollback), E>
pub fn try_transition<T, E>( &mut self, steps: impl FnOnce(&mut Self) -> Result<T, E>, ) -> Result<(T, ViewRollback), E>
Run steps as one transition of the view: planned, never read (no collect
runs while they do), starting with no error showing. If a step fails, the view
before them is put back and the error returned. If they all plan, the view
before them comes back with the result, for the caller to restore with
Self::roll_back should reading the new view’s rows fail.
Sourcepub fn deferred<R>(&mut self, steps: impl FnOnce(&mut Self) -> R) -> R
pub fn deferred<R>(&mut self, steps: impl FnOnce(&mut Self) -> R) -> R
Run steps with every collect they would make left to the caller, who reads
the rows off the UI thread (prepare_async_collect).
Sourcepub fn count_landed(
&mut self,
len_generation: u64,
rows: usize,
file_row_groups: Option<&[Vec<usize>]>,
) -> bool
pub fn count_landed( &mut self, len_generation: u64, rows: usize, file_row_groups: Option<&[Vec<usize>]>, ) -> bool
A background count of frame len_generation came back. Taken when that frame is
the one on screen; returns whether it was.
Sourcepub fn follow(&self) -> Option<&Follow>
pub fn follow(&self) -> Option<&Follow>
The follow of the file this dataset reads, while it is followed.
pub fn follow_mut(&mut self) -> Option<&mut Follow>
Sourcepub fn start_following(&mut self, follow: Follow)
pub fn start_following(&mut self, follow: Follow)
Follow the file this dataset reads with follow, whose watcher is running.
Sourcepub fn stop_following(&mut self)
pub fn stop_following(&mut self)
Stop following. The rows read so far stay.
Sourcepub fn on_last_row(&self) -> bool
pub fn on_last_row(&self) -> bool
Whether the cursor is on the last row of a view whose length is known.
Sourcepub fn lf(&self) -> &LazyFrame
pub fn lf(&self) -> &LazyFrame
The frame on screen: the root, then the query or reshape, the filters and the sort. Column order is applied when rows are read.
Sourcepub fn into_lf(self) -> LazyFrame
pub fn into_lf(self) -> LazyFrame
Hand back the frame on screen, for a caller that built a state only to load it.
Sourcepub fn num_rows(&self) -> usize
pub fn num_rows(&self) -> usize
The rows the frame holds: exact when Self::is_num_rows_valid, else as far as
the reads so far have reached.
Sourcepub fn error(&self) -> Option<&PolarsError>
pub fn error(&self) -> Option<&PolarsError>
Why the last query, step or read failed, while it is still showing.
Sourcepub fn dismiss_error(&mut self)
pub fn dismiss_error(&mut self)
Stop showing the last failure. The view is as it was; only the message goes.
Sourcepub fn partition_columns(&self) -> Option<&[String]>
pub fn partition_columns(&self) -> Option<&[String]>
The hive partition columns the dataset was loaded with.
Sourcepub fn polars_streaming(&self) -> bool
pub fn polars_streaming(&self) -> bool
Whether reads use Polars’ streaming engine.
Sourcepub fn drilled_group_key(&self) -> Option<(&[String], &[String])>
pub fn drilled_group_key(&self) -> Option<(&[String], &[String])>
The group drilled into, as its key columns and their values.
Sourcepub fn sql_table_columns(&self) -> Vec<(String, DataType)>
pub fn sql_table_columns(&self) -> Vec<(String, DataType)>
The columns of df, the table SQL runs against, with their types. From the
schema already known for the data as loaded; a drilled group or a reshape only
has its plan resolved, which reads nothing.
Sourcepub fn sql_table_rows(&self) -> Option<usize>
pub fn sql_table_rows(&self) -> Option<usize>
Rows df holds, when that is known without counting: the data as loaded,
once its count has come back.
pub fn get_active_fuzzy_query(&self) -> &str
pub fn last_pivot_spec(&self) -> Option<&PivotSpec>
pub fn last_melt_spec(&self) -> Option<&MeltSpec>
Sourcepub fn reshape_source(&self) -> Option<&ReshapeSource>
pub fn reshape_source(&self) -> Option<&ReshapeSource>
What the pivot or melt in effect ran over. See the field.
Sourcepub fn is_grouped(&self) -> bool
pub fn is_grouped(&self) -> bool
Whether the view is a grouping’s result (a by query, a SQL GROUP BY), so its
rows drill into groups. Recorded by the query, never inferred from list columns:
a table loaded with one is not grouped.
pub fn group_key_columns(&self) -> Vec<String>
pub fn group_value_columns(&self) -> Vec<String>
Sourcepub fn binary_column_names(&self) -> HashSet<String>
pub fn binary_column_names(&self) -> HashSet<String>
Names of binary columns in the source schema. Their values are not read into the display
buffer (the ‹binary› stub stands in); the renderer uses this to style those cells.
Sourcepub fn buffered_memory_bytes(&self) -> Option<usize>
pub fn buffered_memory_bytes(&self) -> Option<usize>
Estimated heap size in bytes of the currently buffered slice (locked + scrollable), if collected.
Sourcepub fn buffered_rows(&self) -> usize
pub fn buffered_rows(&self) -> usize
Number of rows currently in the buffer. 0 if no buffer loaded.
Sourcepub fn display_df(&self) -> Option<&DataFrame>
pub fn display_df(&self) -> Option<&DataFrame>
Current scrollable display buffer. None until first collect().
Sourcepub fn display_slice_df(&self) -> Option<DataFrame>
pub fn display_slice_df(&self) -> Option<DataFrame>
Visible-window slice of the display buffer (same as passed to render_dataframe).
Sourcepub fn copy_row_df(&self) -> Option<DataFrame>
pub fn copy_row_df(&self) -> Option<DataFrame>
The selected row with every display column, raw and in display order: what a row copy carries.
Sourcepub fn copy_view_df(&self) -> Option<DataFrame>
pub fn copy_view_df(&self) -> Option<DataFrame>
The rows on screen with every display column, raw, in display order and untouched by the column scroll: a copy that lost the columns scrolled past would deny exactly the identifiers that make the rows readable.
Sourcepub fn copy_cell_value(&self, column: &str) -> Option<String>
pub fn copy_cell_value(&self, column: &str) -> Option<String>
The selected row’s value in one column, exactly as stored (see
crate::exact): a float as the decimal that reads back to it, never
the table’s rounded preview. A null is an empty string, like a null in
an export — never the UI’s glyph. A list or struct is JSON, as in a CSV
export.
Sourcepub fn selected_display_row(&self) -> Option<usize>
pub fn selected_display_row(&self) -> Option<usize>
The selected row’s number as the row-numbers column would print it.
Sourcepub fn estimated_copy_bytes(&self) -> Option<usize>
pub fn estimated_copy_bytes(&self) -> Option<usize>
Rows times estimated row width, for the copy guard: what collecting the whole view would hold, with binary at the base64 size a copy writes. None until the count has run, and while a binary column’s width is unknown: the buffer holds a stub for it, so only a footer says how wide it is.
Sourcepub fn display_drift(&self, frame_rows: usize) -> Vec<u32>
pub fn display_drift(&self, frame_rows: usize) -> Vec<u32>
The drift group of each row from the top of the view down, for a frame
frame_rows tall, when the dataset’s files differ.
Sized by the frame about to be drawn rather than by visible_rows, which is
what the last frame drew and is 0 before there has been one. Taking it from
visible_rows left the opening frame of every drifting dataset — the one the
user is looking at when nothing has been pressed yet — with no groups at all,
so every absent cell fell back to the plain null glyph.
Callers pass the whole frame’s height, a header more than the rows it draws.
Deliberately: the table reads this by row index and ignores what it does not
reach, so a group too many costs a u32 and a group too few costs a mark.
Empty once a query or reshape has replaced the frame: those rows stand for no file, so their nulls are ordinary nulls. A frame is a screen tall, so this is a few dozen values.
Sourcepub fn max_buffered_rows(&self) -> usize
pub fn max_buffered_rows(&self) -> usize
Maximum buffer size in rows (0 = no limit).
Sourcepub fn max_buffered_mb(&self) -> usize
pub fn max_buffered_mb(&self) -> usize
Maximum buffer size in MiB (0 = no limit).
Sourcepub fn can_drill_down(&self) -> bool
pub fn can_drill_down(&self) -> bool
Whether Enter on a row drills into its group: the view is a grouped result and not already a group’s rows.
Sourcepub fn inspect_fields(&self) -> Vec<InspectField>
pub fn inspect_fields(&self) -> Vec<InspectField>
The columns the inspector lists for a row: the table’s, in its order, then the ones hidden from it, in schema order. Never the scan’s own row index.
Sourcepub fn inspect_row(&self) -> Option<InspectRow>
pub fn inspect_row(&self) -> Option<InspectRow>
The selected row as the buffer holds it, with the file group that says what
its nulls are. Reads nothing; None while the row is not on hand.
Sourcepub fn inspect_row_at(&self, row: usize) -> Option<InspectRow>
pub fn inspect_row_at(&self, row: usize) -> Option<InspectRow>
Row row of the view as the buffer holds it, as Self::inspect_row does
the selected one: Compare’s next row. None while it is not on hand.
Sourcepub fn null_kind(&self, column: &str, group: Option<u32>) -> NullKind
pub fn null_kind(&self, column: &str, group: Option<u32>) -> NullKind
What a null in column is, for a row of file group group: the data’s own,
a file without the column, or a file holding it in another type.
Sourcepub fn inspect_read_lf(
&self,
row: usize,
columns: &[String],
) -> PolarsResult<LazyFrame>
pub fn inspect_read_lf( &self, row: usize, columns: &[String], ) -> PolarsResult<LazyFrame>
The frame that reads columns of row row of the view: for the inspector’s
fields the buffer does not hold. One row, through the same window the buffer
reads, so a remote dataset reads only the file holding it. Run off this thread.
Sourcepub fn drill_row(&self, group_index: usize) -> Option<DrillRow>
pub fn drill_row(&self, group_index: usize) -> Option<DrillRow>
What drilling into the group on row group_index of the view reads, or None
when the view is not grouped. The row is on screen, so the buffer holds it and
nothing is computed again. A column the buffer lacks (hidden, or a binary stub)
means reading the row, and one row of an aggregate is the whole aggregate, so the
caller reads it off the UI thread.
Sourcepub fn drill_down_into_group(&mut self, group_index: usize) -> Result<()>
pub fn drill_down_into_group(&mut self, group_index: usize) -> Result<()>
Show the rows of the group on row group_index of the view, reading the row on
this thread if the buffer does not hold it. The app goes through
Self::drill_row instead, so that read never holds up a key.
Sourcepub fn drill_down_with_row(
&mut self,
group_index: usize,
row: &DataFrame,
) -> Result<()>
pub fn drill_down_with_row( &mut self, group_index: usize, row: &DataFrame, ) -> Result<()>
Show the rows of the group whose row group_index of the view is row, as
Self::drill_row gave it. A result that holds each group as lists shows those
lists as rows; one that holds only aggregates shows the source rows sharing the
group’s keys, key columns first.
Sourcepub fn drill_into_value(
&mut self,
column: &str,
value: AnyValue<'static>,
) -> Result<()>
pub fn drill_into_value( &mut self, column: &str, value: AnyValue<'static>, ) -> Result<()>
Show the rows of the view holding value in column (null matching nulls),
as a drill into a group does: the breadcrumb names the value, and Esc comes
back to the view. Inside a group already, it narrows that group, and Esc goes
back to the view the group was drilled from.
Sourcepub fn drilled_into_value(&self) -> bool
pub fn drilled_into_value(&self) -> bool
Whether the drill on screen came from Value Counts.
pub fn drill_up(&mut self) -> Result<()>
pub fn get_analysis_dataframe(&self) -> Result<DataFrame>
pub fn get_analysis_context(&self) -> AnalysisContext
Sourcepub fn plan_pivot(&self, spec: &PivotSpec) -> PivotJob
pub fn plan_pivot(&self, spec: &PivotSpec) -> PivotJob
Plan a pivot of the view (long → wide). Nothing is read until the job runs.
Never uses original_lf.
Sourcepub fn install_pivot(
&mut self,
spec: &PivotSpec,
pivoted: DataFrame,
) -> Result<()>
pub fn install_pivot( &mut self, spec: &PivotSpec, pivoted: DataFrame, ) -> Result<()>
Show pivoted, the result of spec’s PivotJob, as the new pipeline root.
Sourcepub fn pivot(&mut self, spec: &PivotSpec) -> Result<()>
pub fn pivot(&mut self, spec: &PivotSpec) -> Result<()>
Pivot the view here and now, reading it on this thread. The Pivot & Melt builder
and views run the PivotJob in the background instead.
Sourcepub fn melt(&mut self, spec: &MeltSpec) -> Result<()>
pub fn melt(&mut self, spec: &MeltSpec) -> Result<()>
Melt the current LazyFrame (wide → long). Never uses original_lf.
Sourcepub fn read_python(&self) -> &[String]
pub fn read_python(&self) -> &[String]
What the open did to the rows its reader gave, as Python method calls.
Sourcepub fn read_notes(&self) -> &[Note]
pub fn read_notes(&self) -> &[Note]
See the field: the notes the read made, for the open to carry to the dataset.
Sourcepub fn read_units(&self) -> Option<&[(String, String)]>
pub fn read_units(&self) -> Option<&[(String, String)]>
See the field.
Sourcepub fn column_changes(&self) -> &[ColumnChange]
pub fn column_changes(&self) -> &[ColumnChange]
The view’s column types and made columns, in the order asked.
Sourcepub fn retyped_columns(&self) -> Vec<String>
pub fn retyped_columns(&self) -> Vec<String>
The columns the view gave a type: the type row draws them in the accent.
Sourcepub fn type_as_read(&self, column: &str) -> Option<DataType>
pub fn type_as_read(&self, column: &str) -> Option<DataType>
column’s type before the view’s: as the read gave it, or as the view made it.
Sourcepub fn values_on_screen(&self, column: &str, n: usize) -> Vec<String>
pub fn values_on_screen(&self, column: &str, n: usize) -> Vec<String>
Up to n of column’s values as read that are not blank, as text: from the
rows on hand, or from the first rows when the view has typed the column.
Sourcepub fn column_type_of(&self, column: &str) -> Option<&ColumnType>
pub fn column_type_of(&self, column: &str) -> Option<&ColumnType>
The type the view gives column, if it gives one.
Sourcepub fn set_column_type(&mut self, column: &str, ty: Option<ColumnType>)
pub fn set_column_type(&mut self, column: &str, ty: Option<ColumnType>)
column as ty, or as read again with None. The view’s own type wins over
what the read gave the column. Lazy: the next rows read are typed.
Sourcepub fn add_made_column(&mut self, derived: Derived) -> Result<(), String>
pub fn add_made_column(&mut self, derived: Derived) -> Result<(), String>
A column made from others, as a spec’s derived column is, before the first column it is made from, which stays. Its name may not be taken.
Sourcepub fn set_column_changes(&mut self, changes: &[ColumnChange]) -> Vec<String>
pub fn set_column_changes(&mut self, changes: &[ColumnChange]) -> Vec<String>
A saved view’s column changes, in place of the view’s own. A change whose column this data does not have is left out, with a note; the names left out are returned.
Sourcepub fn python_steps(&self) -> Vec<Step>
pub fn python_steps(&self) -> Vec<Step>
The view as Copy as Python writes it: every step from the data as loaded to the columns shown, in their order.
pub fn is_drilled_down(&self) -> bool
Sourcepub fn sort(&mut self, columns: Vec<String>, ascending: bool)
pub fn sort(&mut self, columns: Vec<String>, ascending: bool)
Sort with one direction for every column. ascending also sets the natural
order when columns is empty.
Sourcepub fn sort_by(&mut self, columns: Vec<String>, descending: Vec<bool>)
pub fn sort_by(&mut self, columns: Vec<String>, descending: Vec<bool>)
Sort with a direction per column.
pub fn reverse(&mut self)
pub fn filter(&mut self, filters: Vec<FilterStatement>)
pub fn query(&mut self, query: String)
Sourcepub fn query_root(&self) -> LazyFrame
pub fn query_root(&self) -> LazyFrame
The data a query runs against: the drilled group while drilled into one, else the pivot/melt result while one is in effect, otherwise the data as loaded. Never the sidebar filters or sort, which go on top, and never a previous SQL result.
Sourcepub fn sql_query(&mut self, sql: String)
pub fn sql_query(&mut self, sql: String)
Execute a SQL query against query_root (registered as table “df”): the drilled
group or the reshaped data when one is in effect, otherwise the data as loaded —
never the sidebar filters or a previous SQL result. Running a query starts a
fresh view: install_query_result clears the sidebar filters and sort, and they
are applied after it. Empty SQL resets to original state. Does not call
collect(); the event loop does that via AppEvent::Collect.
Sourcepub fn fuzzy_search(&mut self, query: String)
pub fn fuzzy_search(&mut self, query: String)
Fuzzy search: filter rows where any string column matches the query. Query is split on whitespace; each token must match (in order, case-insensitive) in some string column. Empty query resets to original_lf.
Source§impl DataTableState
impl DataTableState
Sourcepub fn forget_drawn(&mut self)
pub fn forget_drawn(&mut self)
Forget where the table was drawn: a frame that does not draw it leaves nothing there to click.
Sourcepub fn drawn_cell(&self, x: u16, y: u16) -> Option<CellHit>
pub fn drawn_cell(&self, x: u16, y: u16) -> Option<CellHit>
What the cell at (x, y) showed in the last frame. None off the table, or
below its last row.
Sourcepub fn drawn_edge(&self, x: u16, y: u16) -> Option<String>
pub fn drawn_edge(&self, x: u16, y: u16) -> Option<String>
The column whose right edge the header cell at (x, y) is: the first cell
of the gap after a column’s last, where a drag resizes it.
Sourcepub fn drawn_column_across(&self, x: u16) -> Option<String>
pub fn drawn_column_across(&self, x: u16) -> Option<String>
The column drawn across x, whatever the row: where a header dragged sideways
is over.
Sourcepub fn drawn_header(&self) -> Option<(Rect, DrawnColumns)>
pub fn drawn_header(&self) -> Option<(Rect, DrawnColumns)>
The header rows as drawn and each column’s cells across, [from, to): where a
header drag draws its drop mark.
Auto Trait Implementations§
impl !Freeze for DataTableState
impl !RefUnwindSafe for DataTableState
impl !UnwindSafe for DataTableState
impl Send for DataTableState
impl Sync for DataTableState
impl Unpin for DataTableState
impl UnsafeUnpin for DataTableState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more