Crates.io | sn |
lib.rs | sn |
version | 0.1.2 |
source | src |
created_at | 2021-03-21 23:47:03.120185 |
updated_at | 2021-03-25 21:43:57.610266 |
description | zero-copy JSON parser |
homepage | https://github.com/Jacherr/sn |
repository | https://github.com/Jacherr/sn |
max_upload_size | |
id | 371888 |
size | 20,905 |
sn is a minimalistic and simple Rust JSON parser.
sn operates by borrowing slices of the input string, meaning no data is copied during the parsing process, which helps improve efficiency.
This library is still in a very early working state and is subject to change a lot as it matures. Use At Your Own Risk.
Loading a JSON file from the filesystem and parsing it into a Value:
use sn::Parser;
use std::fs::read_to_string;
fn main() {
let raw_json = read_to_string("./my_json.json").unwrap();
let mut parser = Parser::new(raw_json.as_bytes());
let parsed_json = parser.parse();
println!("{:?}", parsed_json);
}
Add sn
to your Cargo.toml:
[dependencies]
sn = "0.1.1"