sn 0.1.2

zero-copy JSON parser
Documentation
  • Coverage
  • 100%
    15 out of 15 items documented1 out of 1 items with examples
  • Size
  • Source code size: 20.52 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.36 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Jacherr/sn
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Jacherr

sn

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.

WIP

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.

Examples

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);
}

Usage

Add sn to your Cargo.toml:

[dependencies]

sn = "0.1.1"