json-stream-parser 0.1.5

A JSON parser that is capable of parsing incomplete JSON strings that are streamed in.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use json_stream_parser::parse_stream_with_limits;

#[test]
fn depth_limit_exceeded() {
    let json = "[[[1]]]";
    let result = parse_stream_with_limits(json, Some(2), None);
    assert!(result.is_err());
}

#[test]
fn length_limit_exceeded() {
    let json = "[1,2,3]";
    let result = parse_stream_with_limits(json, None, Some(5));
    assert!(result.is_err());
}