Skip to main content

Crate json_steroids

Crate json_steroids 

Source
Expand description

§json-steroids

A high-performance, zero-copy JSON parsing library for Rust.

§Features

  • Zero-copy string parsing where possible
  • Efficient SIMD-friendly parsing (when available)
  • Derive macros for automatic serialization/deserialization
  • Minimal allocations

§Example

use json_steroids::{Json, JsonSerialize, JsonDeserialize, to_string, from_str};

#[derive(Debug, Json, PartialEq)]
struct Person {
    name: String,
    age: u32,
}

let person = Person { name: "Alice".to_string(), age: 30 };
let json = to_string(&person);
let parsed: Person = from_str(&json).unwrap();
assert_eq!(person, parsed);

Re-exports§

pub use writer::JsonWriter;

Modules§

writer
High-performance JSON writer

Structs§

JsonParser
High-performance JSON parser

Enums§

JsonError
Errors that can occur during JSON parsing or serialization
JsonValue
A dynamic JSON value

Traits§

JsonDeserialize
Trait for types that can be deserialized from JSON
JsonSerialize
Trait for types that can be serialized to JSON

Functions§

from_bytes
Deserialize a value from JSON bytes
from_str
Deserialize a value from a JSON string
parse
Parse JSON into a dynamic value
to_string
Serialize a value to a JSON string
to_string_pretty
Serialize a value to a JSON string with pretty printing

Type Aliases§

Result
Result type alias for JSON operations

Derive Macros§

Json
Combined derive for both serialization and deserialization
JsonDeserialize
Derive macro for JSON deserialization
JsonSerialize
Derive macro for JSON serialization