Narra

Reference

std/toml

std/toml

Parse and write TOML text as a Value of std/shape.

narra
import * as Toml from "std/toml"

The guide teaches it in chapter 13, The standard library.

This page is generated by scripts/std/generate.nra from narrac query --json interface std/toml. Do not edit it.

Types

TomlError

narra
export struct TomlError derives Show, Equatable {
  line: int
  column: int
  reason: string
}

Functions: parse, formatError.

Functions

parse

narra
export function parse(text: string): Result<Value, TomlError> uses alloc

Effects: alloc.

formatError

narra
export function formatError(error: TomlError): string uses alloc

Effects: alloc.

decode

narra
export function decode<T: Shape>(text: string): Result<T, string> uses alloc

Effects: alloc.

encode

narra
export function encode<T: Shape>(value: T): Result<string, string> uses alloc

Effects: alloc.

stringify

narra
export function stringify(value: Value): Result<string, string> uses alloc

Effects: alloc.