Skip to main content

Crate rust_json_parser

Crate rust_json_parser 

Source
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

Launch the JSON Playground

Run my Rust JSON parser directly in your browser using WebAssembly.

§Features

  • Tokenizes JSON input into individual tokens.
  • Parses JSON into structured JsonValue types.
  • 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§

Tokenizer

Enums§

JsonError
Represents errors encountered while tokenizing or parsing JSON.
JsonValue
Represents a JSON value.
Token

Functions§

parse_json
Parses a JSON string into a JsonValue.

Type Aliases§

Result