asyncjsonstream
Async JSON stream reader for selective parsing of large payloads. This is the
standalone home of Extract's AsyncJsonStreamReader implementation.
Why asyncjsonstream
- Stream through large JSON without deserializing the full payload.
- Selectively read keys, values, and arrays using a tokenized reader.
- Handles chunk boundaries and escaped strings correctly.
- Built on Tokio
AsyncRead. - No unsafe code.
Install
Quick start
use AsyncJsonStreamReader;
use Cursor;
async
Common patterns
- Read object entries with
next_object_entry. - Skip values by calling
next_object_entryagain without consuming the value. - Stream arrays with
start_array_item. - Parse string/number/bool with
read_string,read_number,read_boolean. - Deserialize a sub-object with
deserialize_object.
Error handling
All fallible operations return AsyncJsonStreamReaderError:
Iofor reader failuresJsonErrorfor malformed JSONUnexpectedTokenwhen the stream doesn't match the expected structure
MSRV
Minimum supported Rust version is 1.74.
License
Licensed under either of:
- Apache License, Version 2.0 (
LICENSE-APACHE) - MIT license (
LICENSE-MIT)
at your option.