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.
- Text
Facts - 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_rangenames as null, for the Polars operations that overflow or panic on one.Nonewhen it holds none, the common case, which costs a min and a max. - cell_
cut - The cells a preview drawn in
widthcells (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
sthat covers more thancellscells oncepreviewmarks it, or all ofs. Measured by grapheme at ratatui’s widths, a control as its one-cell mark. A value of zero-width graphemes stops at twicecellsgraphemes, so nothing is walked whole. - cell_
preview cell_textofs, cut pastcell_cutofwidth.- cell_
text previewof the start oftextthat covers more thancellscells, ending in the ellipsis when cut: a cell draws only its start, and measuring a huge value whole costs what the value costs. Drawn atcellsor fewer, it reads and measures as the whole value would. An ownedtextthat needs neither cut nor mark is kept, not copied.- copy_
len_ floor - At least how many bytes
copy_textwrites forvalue, counted only until the count passesstop: 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
sas a quoted literal: backslash, quote, line breaks, tabs and every invisible character written as an escape, so a literal\nin 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_textfor anf32, shortest at thef32’s own precision: widened tof64first,0.1f32would read0.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
dtypeis, or holds, a date, datetime or time. - is_
nested_ value - Whether
valueis 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)). PastCELL_PREVIEW_BYTES, more than a cell shows, it stops with.... - marked
- Whether a one-line cell draws
cas 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
budgetbytes 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
budgetbytes 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::MINmicroseconds is real data). A day of margin either side leaves room for a zone’s offset. - past_
calendar_ text - The text
str_valuegives a value Polars panics formatting: a date past the calendar, or a list or struct holding one.Nonefor any other value, which Polars formats as usual. - prefix
- The longest prefix of
sno longer thanbudgetbytes, cut at a character boundary. - preview
- One-line preview of
s: a line break, a tab or anothermarkedcharacter becomes a mark from the glyph set, soline1\nline2does not read asline1line2. A\r\npair is one break. - stored_
out_ of_ range out_of_rangefor a value ofdtypestored as the numberstored.- 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 asnested_compactdoes.- 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.