Module json

Module json 

Source
Expand description

Types and functions for parsing JSON in a flexible and pedantic manner.

Modules§

decode
A WarningKind for warnings that can happen when decoding a JSON &str.
parser
A JSON parse built to keep track of where each element came from in the input.
write
Tools for writing JSON.

Structs§

ElemId
A simple integer index used to ID the given Element within a JSON file.
Element
A JSON Element composed of a Path and it’s [Value].
Error
A parsing Error that keeps track of the token being parsed when the Error occurred and the slice of JSON surrounding the Error location.
ErrorReport
A more comprehensive report on the Error using the source JSON &str to provide human readable context.
LineCol
A file location expressed as line and column.
Path
A path to a JSON Element where the path components are heap allocated and so do not require a lifetime back to the source JSON &str.
PathComponent
A single component of a PathRef.
PathComponents
An Iterator over the components of a path.
PathRef
A path to a JSON Element where the path components are borrowed from the source JSON &str.
UnexpectedFields
A collection of paths that were unexpected according to the schema used while parsing the JSON for an OCPI object.
UnexpectedFieldsIntoIter
UnexpectedFieldsIter
An Iterator over each unexpected field as a PathRef.

Enums§

PathNodeKind
A light weight enum used to indicate the kind of component being visited when using the PathComponents Iterator.
SourceStr
ValueKind
A light-weight type identity for a JSON Value’s content.

Functions§

line_col
Return the line and column indices of the end of the slice.