Skip to main content

Crate rusty_rtos_json

Crate rusty_rtos_json 

Source
Expand description

rusty_rtos_json — coreJSON remade in Rust.

The validator. JSON_Validate, strict ECMA-404. It agrees with coreJSON v3.3.1 on all 318 files of JSONTestSuite and passes the suite outright (95/95 accepted, 188/188 rejected).

The query engine. JSON_SearchConst and JSON_Iterate, diffed against the C over 2,124 queries and 348 iterations as a 3,089-line trace. A query returns a sub-slice of the buffer you already have: no tree, no copy.

Zero allocation throughout, no_std, forbid(unsafe), with a no-panic gate over both halves.

What is not here: a serialiser, which coreJSON does not have either, and JSON_SearchT, which is a cast of JSON_SearchConst that exists only so C callers can pass a mutable buffer.

This is the facade: it re-exports the no_std core. Depend on this crate; reach into the sub-crates only when you are building a port or a backend.

Part of Kairos (Remade With Rust). Plan: docs/plans/rusty_rtos_json.md.

Modules§

prelude
The names a firmware wants in scope.
rtos_core
rusty_rtos_core — the shared vocabulary of the Kairos family.
search
JSON_SearchConst and JSON_Iterate: query a document in place. JSON_SearchConst and JSON_Iterate: the query half of coreJSON.
validate
JSON_Validate: coreJSON’s strict ECMA-404 validator. JSON_Validate: coreJSON’s strict ECMA-404 validator, over a byte slice.

Structs§

Match
A value found by search.
Pair
One key-value pair, or one array element, from iterate.
Pairs
The elements of a collection, as a Rust iterator.

Enums§

Kind
JSONTypes_t, for the types a found value can actually have.
NotFound
Why a search found nothing.
Stopped
Why an iterate stopped.
Validity
JSONStatus_t, for the subset validate can answer with.

Constants§

MAX_DEPTH
JSON_MAX_DEPTH. The C’s default, and the reason there is no recursion.
VERSION
Crate version, for manifests and logs.

Functions§

is_valid
Whether validate accepts this document.
iterate
JSON_Iterate: the next element of a collection, carrying its own cursor.
pairs
Iterate the elements of a collection. See Pairs.
search
JSON_SearchConst: find a value by a dotted, bracketed path.
validate
JSON_Validate: is this a complete, valid JSON document?