Skip to main content

Module formats

Module formats 

Source
Expand description

Codecs over the canonical Document model. Ported from ~/dev/omnist/omnist/formats.py; each format’s reader parses text into crate::document::Doc and its writer projects a Doc back to text.

Unlike crate::oml (omnist’s own format, always lossless), JSON/YAML/ TOML/XML can each fail to hold some value losslessly. Writing is lenient by default: the writer adjusts the value and records the change in a crate::report::WriteReport; strict = true raises crate::error::WriteError (carrying the report) instead. See crate::report.

This issue (#16) added the first of the four: json. Issue #18 added yaml; issue #20 added toml; issue #22 adds xml, the last and structurally different one – see xml.rs’s own doc comment.

Modules§

json
JSON codec. Ported from ~/dev/omnist/omnist/formats.py’s read_json/write_json/check_json.
toml
TOML codec. Ported from ~/dev/omnist/omnist/formats.py’s read_toml/write_toml/check_toml.
xml
XML codec. Ported from ~/dev/omnist/omnist/formats.py’s read_xml/write_xml/check_xml.
yaml
YAML codec. Ported from ~/dev/omnist/omnist/formats.py’s read_yaml/write_yaml/check_yaml.