Skip to main content

Module text

Module text 

Source
Expand description

Input text (docs/spec/input-text.md).

Every string and object member name of a specification, a composition file and caller data is a sequence of Unicode scalar values. A Rust String is always one, so the value entry points need no check. JSON text can still carry an unpaired surrogate escape such as "\ud800", which serde_json refuses to decode. JsonText reads such a document without replacing anything, and check_specification and check_inputs report the same failures as every other runtime: the load failure INVALID_TEXT for a specification or a file, and INVALID_FORM_INPUT for other caller values.

Structs§

JsonTextError
JSON text that is not one JSON document.

Enums§

JsonString
A string or member name of a JSON document: valid text, or the UTF-16 code units of text that holds an unpaired surrogate.
JsonText
A JSON document read without replacing any text.

Constants§

MESSAGE
Message of every input text failure.
VALUE_LIMIT_MESSAGE
Message of every value beyond the limits.

Functions§

check_inputs
Check named caller values in order; absent values are skipped. Invalid text is INVALID_FORM_INPUT naming the value and its path, and a value beyond its limits is INVALID_FORM_INPUT naming the value. Each value’s first failure decides its error.
check_specification
Check a specification and then the composition files an operation reads. Invalid text is the INVALID_TEXT load failure located at its specification path, or at the file name followed by its path in the file; an invalid file name is located at the empty path. A value beyond its limits is INVALID_FORM_INPUT naming spec or files. Each value is checked in walk order: the first failure of the value decides its error.
validate_detail_text
validate_detail over JSON text, with the checks of validate_text for the specification, the files and the base path.
validate_list_text
validate_list over JSON text, with the checks of validate_text for the specification, the files and the base path.
validate_text
validate over JSON text. The specification, the files, the data and the base path are checked for invalid text in that order; each argument is then decoded and validated. Absent data validates an empty object.