simdjson_rust/lib.rs
1//! # simdjson-rust
2//!
3//! High-performance JSON parsing for Rust, backed by the
4//! [simdjson](https://github.com/simdjson/simdjson) C++ library.
5//!
6//! ## Quick Start
7//!
8//! ```rust
9//! use simdjson_rust::dom::Parser;
10//!
11//! let mut parser = Parser::default();
12//! let value = parser
13//! .parse_to_value(r#"{"hello": "world", "n": 42}"#)
14//! .unwrap();
15//! println!("{value:?}");
16//! ```
17//!
18//! ## Serde Support
19//!
20//! With the default `serde` feature you can deserialize directly into any
21//! `serde::Deserialize` type:
22//!
23//! ```rust
24//! # #[cfg(feature = "serde")]
25//! # {
26//! use serde::Deserialize;
27//! use simdjson_rust::serde::from_str;
28//!
29//! #[derive(Deserialize, Debug)]
30//! struct Config {
31//! name: String,
32//! value: u64,
33//! }
34//!
35//! let cfg: Config = from_str(r#"{"name": "example", "value": 99}"#).unwrap();
36//! println!("{cfg:?}");
37//! # }
38//! ```
39
40pub mod dom;
41pub mod error;
42pub mod tape;
43
44#[cfg(feature = "serde")]
45pub mod serde;
46
47/// Re-export the simdjson-sys padding constant.
48pub use simdjson_sys::SIMDJSON_PADDING;