Expand description
§Rust JSON Parser
A JSON parser written in Rust for learning and demonstrating parsing techniques, error handling, and Python integration.
§Try My Rust Parser
Run my Rust JSON parser directly in your browser using WebAssembly.
§Features
- Tokenizes JSON input into individual tokens.
- Parses JSON into structured
JsonValuetypes. - Supports objects, arrays, strings, numbers, booleans, and null.
- Provides descriptive errors for invalid JSON input.
- Supports Python integration through optional PyO3 bindings.
§Example
use rust_json_parser::{parse_json, JsonValue};
let result = parse_json(r#"{"name": "server01"}"#)?;
assert!(matches!(result, JsonValue::Object(_)));§Python Integration
Enable the python feature to build Python bindings using PyO3.
Structs§
Enums§
- Json
Error - Represents errors encountered while tokenizing or parsing JSON.
- Json
Value - Represents a JSON value.
- Token
Functions§
- parse_
json - Parses a JSON string into a
JsonValue.