26 releases

0.13.0 Aug 13, 2024
0.12.1 Dec 20, 2023
0.12.0 Nov 6, 2023
0.11.0 Jul 3, 2023
0.5.2 Mar 23, 2021

#709 in Encoding

Download history 1/week @ 2024-05-28 5/week @ 2024-06-04 3/week @ 2024-06-11 1/week @ 2024-06-18 42/week @ 2024-07-02 126/week @ 2024-07-23 54/week @ 2024-07-30 1/week @ 2024-08-06 147/week @ 2024-08-13 2/week @ 2024-08-20 9/week @ 2024-08-27

158 downloads per month
Used in 2 crates

Apache-2.0

98KB
2.5K SLoC

destream_json

Rust library for encoding and decoding JSON streams

Example:

let expected = ("one".to_string(), 2.0, vec![3, 4]);
let stream = destream_json::encode(&expected).unwrap();
let actual = destream_json::try_decode((), stream).await;
assert_eq!(expected, actual);

lib.rs:

Library for decoding and encoding JSON streams.

Example:

let expected = ("one".to_string(), 2.0, vec![3, 4]);
let stream = destream_json::encode(&expected).unwrap();
let actual = block_on(destream_json::try_decode((), stream)).unwrap();
assert_eq!(expected, actual);

Deviations from the JSON spec:

  • destream_json will not error out if asked to decode or encode a non-string key in a JSON object (i.e., it supports a superset of the official JSON spec). This may cause issues when using another JSON library to decode a stream encoded by destream_json. This behavior can be altered by using only strings as keys, or adding an explicit check at encoding time.

Dependencies

~1.6–8MB
~67K SLoC