packages

toml::write

TOML text of a table: plain keys first, then [table] sections and [[array]] elements, each table under its full dotted header.

Functions

documentSource

pub fn document(t: Dict<str, Value>, o: Options) -> str

t as a document.

prettySource

pub fn pretty(v: Value, indent: usize, col: usize, tail: usize, o: Options) -> str

v starting at column col of a line indented indent, followed by tail more columns: one line if it fits in o.width, else an array (and with 1.1, an inline table) one item per line.

key_textSource

pub fn key_text(k: str) -> str

A key: bare (A-Za-z0-9_-) when it can be, else quoted.

is_bareSource

pub fn is_bare(k: str) -> bool

quotedSource

pub fn quoted(s: str, v: Version) -> str

s as a basic string: ", \ and control characters escaped (with 1.1, as \e / \xHH rather than \u00HH).

float_textSource

pub fn float_text(x: f64) -> str

The shortest digits that read back as x, with a .0 or an exponent so it reads back as a float; inf, -inf, nan.