Skip to main content

DataTableState

Struct DataTableState 

Source
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: bool

Set by the renderer when visible_rows changes; the event loop then starts an async collect.

Implementations§

Source§

impl DataTableState

Source

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.

Source

pub fn slide_table(&mut self, rows: i64) -> bool

Scroll by rows: within the buffer, re-slice the display; outside it, set the position and return true so the caller collects.

Source

pub fn prepare_async_collect( &mut self, num_rows_override: Option<usize>, ) -> Option<CollectRequest>

Plan an async collect without blocking: clamp the start row, then a CollectRequest if the rows on screen need a new buffer, or None (display slices updated). Without num_rows_override, Self::num_rows_bound lets the first rows skip the count.

Source

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.

Source

pub fn sampled(&self) -> Option<&Sampled>

The view’s sample, while it has one.

Source

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.

Source

pub fn files_a_page_reads(&self, start: usize, len: usize) -> Option<usize>

How many files a page at start would read: only for a windowed remote scan; None (not zero) when Polars reads the whole scan as it decides.

Source

pub fn row_numbers_from(&self, start: usize, rows: usize) -> Vec<usize>

What # shows for rows rows from start: source positions where carried, else view positions from row_start_index (the same when pristine).

Source

pub fn estimated_row_bytes(&self) -> usize

The best in-memory width estimate per row, shared by buffer planning and Data Quality’s (approximate) preflight so they agree.

Source

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.

Source

pub fn at_end(&self) -> bool

True when the view already shows the last page, so End has nothing to load.

Source

pub fn wants_to_load_ahead(&self) -> bool

Whether the view is inside the buffer within a page of an end with more data past it: where to grow the buffer ahead, before an in-buffer scroll leaves it blank.

Source

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.

Source§

impl DataTableState

Source

pub fn select_next(&mut self) -> bool

Returns true if a buffer collect is needed after the scroll.

Source

pub fn page_down(&mut self) -> bool

Returns true if a buffer collect is needed after the scroll.

Source

pub fn select_previous(&mut self) -> bool

Returns true if a buffer collect is needed after the scroll.

Source

pub fn scroll_to(&mut self, index: usize) -> bool

Returns true if a buffer collect is needed.

Source

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.

Source

pub fn scroll_to_start(&mut self) -> bool

Jump to the first page. Returns true if a collect is needed.

Source

pub fn scroll_to_end(&mut self) -> bool

Jump to the last page. Returns true if a collect is needed.

Source

pub fn half_page_down(&mut self) -> bool

Returns true if a buffer collect is needed after the scroll.

Source

pub fn half_page_up(&mut self) -> bool

Returns true if a buffer collect is needed after the scroll.

Source

pub fn page_up(&mut self) -> bool

Returns true if a buffer collect is needed after the scroll.

Source

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.

Source

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; moves needing undrawn columns wait as in Self::scroll_columns.

Source

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.

Source

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.

Source

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.

Source

pub fn current_column_index(&self) -> Option<usize>

The cursor’s place among the shown columns, from 0, frozen ones first.

Source

pub fn headers(&self) -> Vec<String>

Source

pub fn set_column_order(&mut self, order: Vec<String>)

Source

pub fn set_locked_columns(&mut self, count: usize)

Source

pub fn locked_columns_count(&self) -> usize

Source

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.

Source

pub fn width_choice(&self, name: &str) -> WidthChoice

How a column’s width is chosen.

Source

pub fn shown_width(&self, name: &str) -> Option<u16>

The width a column was last drawn at, if it has been drawn.

Source

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.

Source

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.

Source§

impl DataTableState

Source

pub fn drilled_group_key(&self) -> Option<(&[String], &[String])>

The group drilled into, as its key columns and their values.

Source

pub fn sql_table_columns(&self) -> Vec<(String, DataType)>

The columns and types of df, the table SQL runs against, from the known schema; a drilled group or reshape only resolves its plan, reading nothing.

Source

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.

Source

pub fn get_active_fuzzy_query(&self) -> &str

Source

pub fn last_pivot_spec(&self) -> Option<&PivotSpec>

Source

pub fn last_melt_spec(&self) -> Option<&MeltSpec>

Source

pub fn reshape_source(&self) -> Option<&ReshapeSource>

What the pivot or melt in effect ran over. See the field.

Source

pub fn is_grouped(&self) -> bool

Whether the view is a grouping’s result (a by query, SQL GROUP BY) whose rows drill into groups; recorded by the query, never inferred from list columns.

Source

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.

Source

pub fn buffered_memory_bytes(&self) -> Option<usize>

Estimated heap size in bytes of the currently buffered slice (locked + scrollable), if collected.

Source

pub fn buffered_span(&self) -> (usize, usize)

The rows on hand, first to past the last.

Source

pub fn buffered_rows(&self) -> usize

Rows in the buffer; 0 when none is loaded.

Source

pub fn display_df(&self) -> Option<&DataFrame>

Current scrollable display buffer. None until first collect().

Source

pub fn display_slice_df(&self) -> Option<DataFrame>

The display buffer’s rows on screen, as the table draws them.

Source

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.

Source

pub fn copy_view_df(&self) -> Option<DataFrame>

The rows on screen with every display column, raw, in display order, ignoring column scroll (scrolled-past identifiers make the rows readable).

Source

pub fn copy_cell_value(&self, column: &str) -> Option<String>

The selected row’s value in column, exactly as stored (crate::exact): floats as their round-tripping decimal, null as empty (as in exports), lists and structs as JSON.

Source

pub fn selected_display_row(&self) -> Option<usize>

The selected row’s number as the row-numbers column would print it.

Source

pub fn estimated_copy_bytes(&self) -> Option<usize>

Rows times estimated row width (binary at base64 size), for the copy guard. None until counted, or while a binary column’s width is unknown (only a footer says).

Source

pub fn display_drift(&self, frame_rows: usize) -> Vec<u32>

Each row’s drift group from the top of the view, for a frame frame_rows tall (the whole frame, header included: extra entries are ignored, and visible_rows is 0 before the first frame). Empty once a query or reshape replaced the frame (its rows stand for no file).

Source

pub fn max_buffered_rows(&self) -> usize

Maximum buffer size in rows (0 = no limit).

Source

pub fn max_buffered_mb(&self) -> usize

Maximum buffer size in MiB (0 = no limit).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn inspect_read_lf( &self, row: usize, columns: &[String], ) -> PolarsResult<LazyFrame>

The frame reading columns of view row row for the inspector, through the buffer’s window (a remote dataset reads only that file). Run off this thread.

Source

pub fn drill_row(&self, group_index: usize) -> Option<DrillRow>

What drilling into the group on view row group_index reads, or None when not grouped. The buffer holds the row; a missing column (hidden, binary stub) means reading the row, which for an aggregate is the whole aggregate, so off the UI thread.

Source

pub fn drill_down_into_group(&mut self, group_index: usize) -> Result<()>

Show the group on view row group_index, reading the row on this thread if not buffered; the app uses Self::drill_row so keys never wait.

Source

pub fn drill_down_with_row( &mut self, group_index: usize, row: &DataFrame, ) -> Result<()>

Show the group whose row group_index is row (from Self::drill_row): list columns as rows, or for aggregates the source rows sharing the group’s keys, key columns first.

Source

pub fn drill_into_value( &mut self, column: &str, value: AnyValue<'static>, ) -> Result<()>

Show the view’s rows with value in column (null matches null), like a group drill: breadcrumb names the value, Esc returns. Inside a group, it narrows that group and Esc returns to the view it was drilled from.

Source

pub fn drilled_into_value(&self) -> bool

Whether the drill on screen came from Value Counts.

Source

pub fn drill_up(&mut self) -> Result<()>

Source§

impl DataTableState

Source

pub fn forget_drawn(&mut self)

Forget where the table was drawn: a frame that does not draw it leaves nothing there to click.

Source

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.

Source

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.

Source

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.

Source

pub fn point_at(&mut self, hit: &CellHit) -> bool

Put the cursor on what a click landed on: the row, when the rows drawn are still the view’s, and the column. Returns whether it is there now, row and column both.

Source§

impl DataTableState

Source

pub fn analysis_lf(&self) -> LazyFrame

The frame an analysis reads: the view as filtered and queried, unsorted (no statistic needs order, and a sort makes a sampled read read everything).

Source

pub fn preview_lf(&self) -> LazyFrame

What the Pivot & Melt builder previews: the view’s columns, unsorted (a sort would make the head of a large table a full read).

Source

pub fn is_sorted(&self) -> bool

Whether the view has a sort, which Self::preview_lf leaves out.

Source

pub fn scan_is_the_root(&self) -> bool

Whether the frame on screen still grows from the dataset’s scan. Filters and sorts are rebuilt over any root, so they do; a query, SQL, fuzzy search, pivot, melt or drill-down makes its own result the root, and widening the scan under it would leave the view naming missing columns.

Source

pub fn measurements(&self) -> &Arc<Meter> ⓘ

What finding and reading this dataset cost.

Source

pub fn parquet_count_dir(&self) -> Option<PathBuf>

The directory whose Parquet footers sum to an exact row count, if lf still allows it.

Source

pub fn len_generation(&self) -> u64

Current count generation; a background len() result applies only if it still matches.

Source

pub fn num_rows_if_valid(&self) -> Option<usize>

The cached row count when valid (the footer’s), sparing analysis a full scan.

Source

pub fn is_num_rows_valid(&self) -> bool

Whether num_rows reflects the current lf, deciding whether a background len() goes before the buffer collect.

Source

pub fn lf_clone(&self) -> LazyFrame

Clone of the LazyFrame for off-thread queries (e.g. background len()).

Source

pub fn polars_streaming_enabled(&self) -> bool

Whether the current LazyFrame should use Polars streaming engine.

Source

pub fn buffered_start(&self) -> usize

Start row of the currently buffered range.

Source

pub fn buffered_end(&self) -> usize

End row (exclusive) of the currently buffered range.

Source

pub fn is_remote_source(&self) -> bool

True for a scan of an object store in place. Polars fetches a whole row group for any slice and caches nothing, so a remote buffer is one window of max_buffered_rows around the view: scrolling inside is free, leaving it or a jump costs one fetch.

Source

pub fn source_schema(&self) -> &Arc<Schema> ⓘ

The schema as loaded, before queries or reshapes: what a view’s settings run on and its schema rule matches.

Source

pub fn footers_pending(&self) -> Option<FootersJoin>

The pass that is still reading this dataset’s footers, if one is.

Source

pub fn counts_itself_later(&self) -> bool

Whether this frame’s row count is already coming: a staged open still reading footers (which hold the count) or line indexing in progress. The frame matters: a query’s result has its own count nobody else will take.

Source

pub fn indexing(&self) -> Option<&Arc<Lines>>

The lines being indexed behind the first rows, if they still are.

Source

pub fn lines_to_index(&self) -> Option<&Arc<Lines>>

The lines this dataset opened from in part, until told all are in (even while paused): what an indexing thread works on.

Source

pub fn row_estimate(&self, pass: Option<RowEstimate>) -> Option<RowEstimate>

The row count estimated from sampled footers, while the frame is the dataset as loaded and uncounted. pass is the still-running footer pass’s estimate.

Source

pub fn file_row_starts(&self) -> Option<Vec<usize>>

Where each file starts in the view, the total last: while the view keeps the dataset’s rows and every file’s rows are known.

Source

pub fn files_to_count(&self) -> Option<usize>

How many files a count of the dataset reads footers of, when it reads them.

Source

pub fn numbered_by_default(&self) -> bool

Whether # defaults on for this format: text and logs, whose rows have a place in the file.

Source

pub fn row_numbers_count_the_view(&self) -> bool

Whether # numbers rows by view position because they lack a source position: a sorted or filtered view of a store, many files, or too large to number.

Source

pub fn give_up_on_pending_footers(&mut self)

Give up on the remaining footers (the pass failed): the dataset stays as opened and stops waiting, so it can count itself rather than lose its exact count and windowed reads for the session.

Source

pub fn join_dataset_schema( &mut self, found: FootersFound, ) -> Result<(), Box<FootersFound>>

Join every footer’s answer to the dataset on screen. Columns only join: new names go on the end, existing ones keep their (user-arranged) places. The frame is rebuilt, since the scan now knows conflicting files and can number rows (telling absent from null). Returned as Err while the view is built on the scan (see Self::scan_is_the_root): rebuilding the root under a query takes its columns, so the caller holds them for later.

Source

pub fn visible_lf(&self) -> LazyFrame

The frame as the user sees it: lf without the hidden row-index column. Exports, reshapes, groups and analyses read this; the buffer keeps the column to trace rows to files (display_drift), invisible since display projects column_order.

Source

pub fn scans_a_temp_file(&self) -> bool

Whether the frame scans a temp file this state holds (a decompressed archive), removed when the last holder drops; an exit capture must not reference it.

Source

pub fn scans_a_download(&self) -> bool

Whether the frame scans a downloaded remote file, removed when released; see Self::scans_a_temp_file.

Source

pub fn read_mode(&self) -> Option<ReadMode>

How the open reads the data; None for a frame handed in whole (from Python).

Source

pub fn read_as(&self) -> Option<FileFormat>

The format the open read the data as. See OpenFacts::read_as.

Source

pub fn fetched(&self) -> bool

Whether the data was downloaded from a remote source before it was read.

Source

pub fn drifts(&self) -> bool

Whether rows still know which file they came from.

Source

pub fn drift_groups(&self) -> Arc<Vec<DriftGroup>> ⓘ

What each drift group is missing, for the renderer. Empty when nothing drifts.

Source

pub fn can_name_source_files(&self) -> bool

Whether an export can name each row’s file: the frame still has the row index and the dataset has files.

Source

pub fn export_frame(&self, name_files: bool) -> ExportFrame

The rows an export writes, planned: the view, with a column naming each row’s file in place of the hidden row index when name_files asks and the dataset can; otherwise the index is dropped.

Source

pub fn notes(&self) -> Vec<Note>

What datui noticed: about the dataset on open, then about the view. Empty when nothing.

Source

pub fn not_the_table(&self) -> Option<&'static str>

The lake format whose plain files this dataset is, for the footer chip so the row count does not read as the table’s.

Source

pub fn other_tables(&self) -> &[String]

The file’s other tables, as --table names them; empty for a file of one.

Source

pub fn format_read(&self) -> Option<&Arc<Read>>

What a read through a format spec found, when the dataset was read through one.

Source

pub fn delimited_read(&self) -> Option<&Arc<DelimitedRead>>

What a read through a delimited spec found, when the dataset was read through one.

Source

pub fn unit_of(&self, column: &str) -> Option<&str>

The unit of column, from a delimited spec’s unit row or the file. Columns kept through filters, sorts, drills or queries (renamed or not) keep it; computed columns have none.

Source

pub fn units(&self) -> Vec<(String, String)>

Each column of the view that has a unit, with it.

Source

pub fn format_detail(&self) -> Option<&Detail>

What the file said besides its rows: its Info panel tab.

Source

pub fn has_notes(&self) -> bool

Whether datui noticed anything, without building notes().

Source

pub fn notes_unseen(&self) -> bool

Whether there is something to say that has not been offered yet.

Source

pub fn mark_notes_seen(&mut self)

The Info panel has been opened; the quiet accent has done its job.

Source

pub fn read_column_as_text(&mut self, column: &str) -> PolarsResult<bool>

Read column as text from every file, showing values a type conflict hid. Rebuilds the scan from what is on hand (files, row counts, per-file types): no listing, footer read or request. Filters and sort are re-applied. Returns whether anything happened (false if not on offer or already read so); a failed scan is kept as the error and returned.

Source

pub fn read_as_text(&self) -> &[PlSmallStr]

The columns being read as text rather than as the type most rows have.

Source

pub fn dataset_schema(&self) -> Option<&DatasetSchema>

What the footers said about the dataset’s columns, when it is many files.

Source

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, files uncounted). Not while a footer pass runs: it brings the row groups, and this would read every footer again.

Source§

impl DataTableState

Source

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.

Source

pub fn install_pivot( &mut self, spec: &PivotSpec, pivoted: DataFrame, ) -> Result<()>

Show pivoted, the result of spec’s PivotJob, as the new pipeline root.

Source

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.

Source

pub fn melt(&mut self, spec: &MeltSpec) -> Result<()>

Melt the current LazyFrame (wide → long). Never uses original_lf.

Source

pub fn read_python(&self) -> &[String]

What the open did to the rows its reader gave, as Python method calls.

Source

pub fn column_changes(&self) -> &[ColumnChange]

The view’s column types and made columns, in the order asked.

Source

pub fn retyped_columns(&self) -> Vec<String>

The columns the view gave a type: the type row draws them in the accent.

Source

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.

Source

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.

Source

pub fn column_type_of(&self, column: &str) -> Option<&ColumnType>

The type the view gives column, if it gives one.

Source

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.

Source

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.

Source

pub fn set_column_changes(&mut self, changes: &[ColumnChange]) -> Vec<String>

Replace the view’s column changes with a saved view’s; changes whose column is missing are left out with a note, their names returned.

Source

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.

Source

pub fn is_drilled_down(&self) -> bool

Source

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.

Source

pub fn sort_by(&mut self, columns: Vec<String>, descending: Vec<bool>)

Sort with a direction per column.

Source

pub fn reverse(&mut self)

The view the other way round: every sort column’s direction flipped, or the natural order reversed, so r twice is always the identity.

Source

pub fn apply_view( &mut self, order: Vec<String>, locked: usize, filters: Vec<FilterStatement>, columns: Vec<String>, descending: Vec<bool>, ) -> ViewChange

The sidebar’s Apply: the column order, the frozen count, the filters and the sort as one change, planned once and read from the top.

Source

pub fn filter(&mut self, filters: Vec<FilterStatement>)

Source

pub fn query(&mut self, query: String)

Source

pub fn sql_query(&mut self, sql: String)

Run SQL against query_root (registered as table “df”), starting a fresh view: install_query_result clears filters and sort, reapplied after. Empty SQL resets. Does not collect; the event loop does (AppEvent::Collect).

Fuzzy search: keep rows where every whitespace-separated token matches (in order, case-insensitive) in some string column. An empty query resets.

Source§

impl DataTableState

Source

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).

Source

pub fn get_sort_columns(&self) -> &[String]

Source

pub fn get_sort_ascending(&self) -> bool

Source

pub fn get_sort_descending(&self) -> &[bool]

Source

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.

Source

pub fn view_sort_columns(&self) -> &[String]

Source

pub fn view_sort_ascending(&self) -> bool

Source

pub fn view_sort_descending(&self) -> &[bool]

Source

pub fn get_column_order(&self) -> &[String]

Source

pub fn is_at_defaults(&self) -> bool

Whether the table shows its defaults (no query, filters, sort or reshape, file order, nothing locked): a view saved from here carries nothing and, matching by schema, would shadow real views.

Source

pub fn get_active_query(&self) -> &str

Source

pub fn get_active_sql_query(&self) -> &str

Source

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.

Source

pub fn rollback_point(&self) -> ViewRollback

The view as it is now, to go back to if a query fails while running.

Source

pub fn roll_back(&mut self, saved: ViewRollback)

Restore the view rollback_point saved, with no error showing, with its row count, buffer, and any count that landed meanwhile (ViewRollback::count_landed). Reads nothing. A checkpoint over since-replaced data (a footer join, a column read as text) would mix roots, so the view returns to the data as loaded instead.

Source

pub fn try_transition<T, E>( &mut self, steps: impl FnOnce(&mut Self) -> Result<T, E>, ) -> Result<(T, ViewRollback), E>

Run steps as one view transition, planned but never read, with no error showing. A failing step restores the prior view and returns its error; on success the prior view comes back with the result, for Self::roll_back if the new rows fail.

Source

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).

Source

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.

Source

pub fn follow(&self) -> Option<&Follow>

The follow of the file this dataset reads, while it is followed.

Source

pub fn follow_mut(&mut self) -> Option<&mut Follow>

Source

pub fn start_following(&mut self, follow: Follow)

Follow the file this dataset reads with follow, whose watcher is running.

Source

pub fn stop_following(&mut self)

Stop following. The rows read so far stay.

Source

pub fn on_last_row(&self) -> bool

Whether the cursor is on the last row of a view whose length is known.

Source

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.

Source

pub fn schema(&self) -> &Arc<Schema> ⓘ

The schema of the frame on screen.

Source

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.

Source

pub fn error(&self) -> Option<&PolarsError>

Why the last query, step or read failed, while it is still showing.

Source

pub fn dismiss_error(&mut self)

Stop showing the last failure. The view is as it was; only the message goes.

Source

pub fn start_row(&self) -> usize

The first row of the page on screen.

Source

pub fn partition_columns(&self) -> Option<&[String]>

The hive partition columns the dataset was loaded with.

Source

pub fn polars_streaming(&self) -> bool

Whether reads use Polars’ streaming engine.

Source§

impl DataTableState

Source

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>

Source

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.

Source

pub fn from_schema_and_lazyframe( schema: Arc<Schema>, lf: LazyFrame, options: &OpenOptions, partition_columns: Option<Vec<String>>, ) -> Result<Self>

State from a pre-collected schema and LazyFrame (phased loading), without collect_schema(); df is None so headers render while the first collect runs. Hive partition columns come first.

Source

pub fn with_open(self, facts: OpenFacts) -> Self

The state with everything the open found in facts: the only way findings reach a state, while pristine, applied in dependency order (files before row groups, which set the count). Later learning goes through Self::join_dataset_schema and Self::count_landed.

Source

pub fn reset(&mut self)

Back to the table as opened: nothing applied, widths relearned from the first page.

Source

pub fn set_row_numbers(&mut self, enabled: bool)

Source

pub fn toggle_row_numbers(&mut self) -> bool

Toggle #. Returns whether the frame changed and rows must be reread (a sorted or filtered view of position-less data numbers its rows).

Source

pub fn row_numbers(&self) -> bool

Whether the row-number column is shown.

Source

pub fn row_start_index(&self) -> usize

Row number display start (0 or 1); used by go-to-line to interpret user input.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

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

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<T> PlanCallbackArgs for T

Source§

impl<T> PlanCallbackOut for T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more