Skip to main content

Module exact

Module exact 

Source
Expand description

A stored value as text, exactly, apart from how the table previews it.

The table’s preview rounds floats, groups digits and cuts long text to fit a cell; a copy or the inspector gives back what is stored. A float is the shortest decimal that reads back to the same bits, never Polars’ compact display; a datetime carries every digit of its unit and its zone’s offset. Exact means the stored value: a CSV’s 1.50 was stored as 1.5.

Structs§

Bounded
Text cut to a byte budget, and whether anything was cut.
TextFacts
The facts about text that its look on screen hides: how long it is, how many lines it runs to, and whitespace at either end.

Constants§

CELL_PREVIEW_BYTES
Bytes of a nested value a table cell previews: more than any terminal row draws.

Functions§

base64_text
Bytes as base64, the spelling every copy and export of a binary uses.
calendar_without_out_of_range
A date, datetime or time column with each value out_of_range names as null, for the Polars operations that overflow or panic on one. None when it holds none, the common case, which costs a min and a max.
cell_cut
The cells a preview drawn in width cells (a terminal, or the area it is drawn in) keeps of a value: past that width and past any width a column can be set to by hand, so the cut never shows.
cell_prefix
The start of s that covers more than cells cells once preview marks it, or all of s. Measured by grapheme at ratatui’s widths, a control as its one-cell mark. A value of zero-width graphemes stops at twice cells graphemes, so nothing is walked whole.
cell_preview
cell_text of s, cut past cell_cut of width.
cell_text
preview of the start of text that covers more than cells cells, ending in the ellipsis when cut: a cell draws only its start, and measuring a huge value whole costs what the value costs. Drawn at cells or fewer, it reads and measures as the whole value would. An owned text that needs neither cut nor mark is kept, not copied.
copy_len_floor
At least how many bytes copy_text writes for value, counted only until the count passes stop: a copy can be refused at a cap before it is formatted, and a million-item list is not walked to learn that it is over. Text is its length and bytes their base64; a list or struct is counted from its punctuation and leaves, each at its shortest JSON.
copy_text
One cell of a one-row column as copy text: exact scalars, nested values as the JSON an export writes, bytes as base64, a null as empty.
escape_char
One character of escaped’s literal, without the quotes around it: the inspector escapes a long value a piece at a time.
escaped
s as a quoted literal: backslash, quote, line breaks, tabs and every invisible character written as an escape, so a literal \n in the data ("\\n") never reads as a line break, and leading or trailing spaces and an empty string show by the quotes around them.
escaped_bytes
Bytes as a quoted literal: printable ASCII as itself, the rest as \xNN.
f32_text
f64_text for an f32, shortest at the f32’s own precision: widened to f64 first, 0.1f32 would read 0.10000000149011612.
f64_text
The shortest decimal that parses back to v: plain notation over the magnitudes people read as plain numbers, exponent notation outside them. NaN, the infinities and negative zero are spelled out rather than lost.
holds_calendar
Whether dtype is, or holds, a date, datetime or time.
is_nested_value
Whether value is a list, array or struct.
list_preview
How the table previews a list cell: its first ten items, and how many there are when that is not all of them ([a, b...] (12 items)). Past CELL_PREVIEW_BYTES, more than a cell shows, it stops with ....
marked
Whether a one-line cell draws c as a mark rather than as itself: a control character, which a cell cannot draw, or a direction control, which a terminal that lays out bidirectional text would apply to the rest of the row.
nested_compact
A list, array or struct on one line, stopping once budget bytes are written: for a preview, which shows only the start.
nested_len
How many items a list or array holds, or fields a struct has.
nested_pretty
A list, array or struct laid out one item per line, indented, stopping once budget bytes are written. Scalars inside are exact; text is quoted and escaped so an item’s edges are visible.
out_of_range
A date, datetime or time outside the calendar’s range, as its stored number: Polars panics formatting one (a sentinel like i64::MIN microseconds is real data). A day of margin either side leaves room for a zone’s offset.
past_calendar_text
The text str_value gives a value Polars panics formatting: a date past the calendar, or a list or struct holding one. None for any other value, which Polars formats as usual.
prefix
The longest prefix of s no longer than budget bytes, cut at a character boundary.
preview
One-line preview of s: a line break, a tab or another marked character becomes a mark from the glyph set, so line1\nline2 does not read as line1line2. A \r\n pair is one break.
stored_out_of_range
out_of_range for a value of dtype stored as the number stored.
str_value
AnyValue::str_value, which panics on a date past the calendar, with such a value written as its stored number, and a list or struct holding one written as nested_compact does.
text_facts
value_text
A value as exact text. A null is empty, as in an export; a list or struct is compact JSON-like text over exact scalars; bytes are base64.