std/toml
TOML source text values. Toml"..." and Toml"""...""" preserve TOML
as data while giving callers and editor tooling a format-specific type.
Import with import std/toml.
Exports
Section titled “Exports”Types
type Toml
Section titled “type Toml”type Toml String
TOML source text as a distinct value.
Use Toml"""...""" when an API expects TOML content rather than an
arbitrary String.
Toml.text
Section titled “Toml.text”fn text(source: Toml): String
type function on Toml
Returns the literal TOML text.
Interactive Tests
assert Toml.text(
Toml"""
[package]
name = "demo"
"""
) == """
[package]
name = "demo"
"""
Toml.from_fragments
Section titled “Toml.from_fragments”impl Literal
fn from_fragments(fragments: List<Fragment<Display>>): Toml
impl Literal.from_fragments
Toml.inspect
Section titled “Toml.inspect”impl Debug
fn inspect(value: Toml): String
impl Debug.inspect