json-stream
A library to parse Newline Delimited JSON values from a byte stream.
The motivating use-case for this crate is parsing newline-delimited json values from Axum's BodyStream, but can be used with any Stream<Item = Result<B, E>>
where B: Deref<Target = [u8]>
.
Memory usage
JsonStream
is designed to minimize the usage of memory to be able to handle any sized stream. When JSON values are deserialized, the bytes are deleted from the underlying buffer. This is to make room for the next chunk of bytes we'll read in when necessary.
Example
use JsonStream;
use once;
use StreamExt;
use Deserialize;
async