Crates.io | zjson |
lib.rs | zjson |
version | 0.1.5 |
source | src |
created_at | 2024-04-17 23:21:10.01313 |
updated_at | 2024-04-24 19:05:21.708217 |
description | Parse JSON with zero allocation. |
homepage | https://github.com/tomboddaert/zjson/ |
repository | https://github.com/tomboddaert/zjson/ |
max_upload_size | |
id | 1211880 |
size | 113,879 |
zjson
)Parse JSON with zero allocation.
This library is still in development. We still need:
If you would like to contribute to this, please open an issue or contact me directly.
Create a document from a JSON string.
Call next
on any container (document, object, array) to get the next value.
The returned value must be fully parsed before continuing.
Match on the returned Any
value to handle each type.
Call get
on a single value (string, number, boolean, null) to get it.
Call finish
on a value to skip it (so that the parent container can continue).
alloc
- adds features that require allocation (only allocating escaped strings, there is a no-alloc alternative)std
(enables alloc
, default) - adds features that require std
(Error
impls)The parser is (hopefully) ECMA 404 complient, including support for Unicode surrogate pairs. The diagram on json.org is a great representation of the standard.
This library is designed to be fast and require no allocations.
This means that the API is more complex than something like serde
with serde_json
.
There are examples in the examples directory.
Zero JSON is licensed under either the MIT license or the Apache License Version 2.0 at your option.