Skip to main content

Module format

Module format 

Source
Available on crate features json or toml or yaml only.
Expand description

The input format interface: what a format reads a text into, and how it reads one scalar for the type a field needs.

The built-in formats, YAML with yaml, JSON with json and TOML with toml, and a format a CLI writes are the same kind of thing: a Format in a Formats registry. Format::read turns text into the located tree, and Format::resolve gives each scalar its meaning, so every format keeps its own scalar rules.

Structs§

Jsonjson
JSON by RFC 8259, with no option that loosens it. Its extension is json.
Mismatch
A scalar the format cannot read as the type a field wanted.
Refusal
Why a Format::read refused a text, and where.
Tomltoml
TOML, read by the toml crate. Its extension is toml.
Yamlyaml
YAML, read by serde-saphyr’s located reader. Its extensions are yaml and yml.

Enums§

Fault
What a read of a text or of a typed value found wrong.
Raise
Where a person raises a limit a text went past.
Reading
What a Format::read refuses besides syntax.
Resolved
A scalar read for the type a field needs.
Wanted
The type a field needs a scalar read as.

Statics§

JSONjson
The JSON format, for Formats::add.
TOMLtoml
The TOML format, for Formats::add.
YAMLyaml
The YAML format, for Formats::add.

Traits§

Format
A way to write input, read into the located tree.