Crate kaydle_primitives

Source
Expand description

This crate contains parsers and other low-level helper types for handling KDL documents. It is a complete but highly skeletal KDL implementation, suitable for use by KDL crate authors to provide higher level access to KDL data. Unless you’re working on a KDL implementation, you should probably not be using this crate.

Modules§

annotation
Parsers and types related to annotations, which are optional string tags that can precede nodes and values. Usually used for type hinting, especially in dynamic languages.
node
A system for parsing entire nodes and node lists. Unlike the rest of kaydle-primitives, this module doesn’t expose ordinary nom parsers and container types. Instead, because it’s designed specifically to support the implementation of a serde deserializer, it exposes a set of “processors”, which can be used to fetch nodes or the contents of nodes step-by-step.
number
Parsers and utility types for parsing KDL numbers. While KDL doesn’t distinguish between floats and integers, or signed and unsigned numbers, this module uses some simple logic to detect different integer types, to aid with deserialization.
property
Parser and container type for KDL properties. A property is a key-value pair, where a key is a KDL identifier and a value is a (possibly annotated) KDL value, separated by =.
string
Parsers and utility types for parsing KDL strings and identifiers.
value
Parsers and utility types related to parsing primitive values. Values can be null, true, false, a number, or a string.
whitespace
Various whitespace parsers. We never care about the contents of whitespace so they always return ()

Functions§

parse_bool
Parse a true or false
parse_null
Parse the string null