sn/lib.rs
1//! # sn
2//!
3//! sn is a minimalistic and simple Rust JSON parser.<br>
4//! sn operates by borrowing slices of the input string, meaning no data is copied during the parsing process, which helps improve efficiency.
5//!
6//! ## WIP
7//!
8//! This library is still in a very early working state and is subject to change a lot as it matures.
9//! Use At Your Own Risk.
10//!
11//! ## Bytes
12//! `Bytes` is a struct used internally to represent string slices, encoded as &[u8].
13//! The primary use case for this struct is the Debug implementation, which converts the contents
14//! to a string.
15//!
16//! ## Examples
17//! Loading a JSON file from the filesystem and parsing it into a Value:
18//!
19//!
20//! ```rust
21//! use sn::Parser;
22//!
23//! let raw_json = r#"{ "a": [1, 2, 3], "b": null }"#;
24//! let mut parser = Parser::new(raw_json.as_bytes());
25//! let parsed_json = parser.parse();
26//!
27//! println!("{:?}", parsed_json);
28//! ```
29//!
30//! ## Usage
31//!
32//! Add `sn` to your Cargo.toml:
33//!
34//! ```toml
35//! [dependencies]
36//! sn = "0.1.2"
37//! ```
38
39#![deny(missing_docs)]
40
41mod bytes;
42mod parser;
43mod stream;
44mod util;
45
46pub use parser::{ParseError, Parser, Value};
47pub use stream::Stream;