Skip to content

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.

Types

type Toml String

TOML source text as a distinct value.

Use Toml"""...""" when an API expects TOML content rather than an arbitrary String.

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

impl Literal

fn from_fragments(fragments: List<Fragment<Display>>): Toml

impl Literal.from_fragments

impl Debug

fn inspect(value: Toml): String

impl Debug.inspect