pub fn decode_stream<R: Read>(
reader: R,
options: Option<&DecodeOptions>,
) -> Result<Value, Error>Expand description
Decode a TOON-formatted stream from a reader to a JSON value
This function reads and parses the TOON format incrementally from the reader without loading the entire input into memory, making it suitable for large datasets.
§Arguments
reader- The reader to read the TOON-formatted input from (will be wrapped in BufReader)options- Optional decoding options
§Returns
A Result containing the decoded JSON value or an error
§Example
use std::fs::File;
use toon_rust::decode_stream;
let file = File::open("input.toon").unwrap();
let value = decode_stream(file, None).unwrap();