#serde-json #json #framing

no-std json-lines

A no_std + serde compatible message library implementing JSON Lines

3 releases

0.1.2 Jan 4, 2025
0.1.1 Nov 21, 2023
0.1.0 Nov 20, 2023

#658 in Embedded development

Download history 46/week @ 2025-11-04 82/week @ 2025-11-11 101/week @ 2025-11-18 133/week @ 2025-11-25 122/week @ 2025-12-02 83/week @ 2025-12-09 90/week @ 2025-12-16 182/week @ 2025-12-23 129/week @ 2025-12-30 68/week @ 2026-01-06 80/week @ 2026-01-13 244/week @ 2026-01-20 631/week @ 2026-01-27 640/week @ 2026-02-03 71/week @ 2026-02-10 209/week @ 2026-02-17

1,674 downloads per month

MIT/Apache

16KB
221 lines

json-lines

Crates.io Documentation Crate License Dependency status build

json-lines is a #![no_std] + serde compatible message library implementing the JSON Lines format.

High-level overview

The crate provides a Rust-language implementation of JSON Lines (JSONL), also known as Newline-Delimited JSON (NDJSON).

The wikipedia page JSON Streaming and jsonlines.org are good resources describing the format.

This crate endeavors to have a similar API to the postcard crate. This way, Rust code can easily switch between JSONL and postcard formats depending on requirements. JSONL is "self-describing" but less efficient, whereas postcard is very compact but requires an out-of-band knowledge of message structure.

The crate contains a #![no_std] implementation for use in, e.g. embedded contexts. The std feature is enabled by default and provides things such as the [Error] enum implements the std::error::Error Trait.

The codec feature enables compilation of crate::codec::JsonLinesCodec, which provides an implementation of tokio_util::codec::Decoder and tokio_util::codec::Encoder.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1.1–2.5MB
~50K SLoC