Expand description
json_lib - A lightweight, modular JSON toolkit for Rust
This library provides a flexible JSON implementation with:
- Core Node type for representing JSON structures
- Parser to build Node trees from streams
- Multiple format serializers (JSON, YAML, XML, Bencode)
- File and buffer I/O abstractions (with
file-iofeature) - Pretty-printing utilities
- Unicode-aware file handling (with
file-iofeature)
§no_std Support
This library supports no_std environments with the alloc crate.
Disable default features and enable only what you need:
[dependencies]
json_lib = { version = "0.1", default-features = false, features = ["alloc"] }Minimum supported Rust version: 1.88.0
Re-exports§
pub use error::parse_error::ParseError;pub use stringify::pretty::stringify_pretty;pub use file::file::Format;pub use file::file::detect_format;pub use file::file::read_file_to_string;pub use file::file::write_file_from_string;pub use misc::get_version as version;pub use misc::print;pub use misc::strip as strip_whitespace;pub use io::destinations::buffer::Buffer as BufferDestination;pub use io::destinations::file::File as FileDestination;pub use io::sources::buffer::Buffer as BufferSource;pub use io::sources::file::File as FileSource;pub use nodes::node::Node;pub use nodes::node::Numeric;pub use parser::config::ParserConfig;pub use parser::default::from_bytes;pub use parser::default::from_str;pub use parser::default::parse;pub use parser::default::parse_with_config;pub use parser::stats::ParseStats;pub use parser::validate::validate_json;pub use parser::arena;pub use parser::fast;pub use parser::sso;pub use stringify::optimized::stringify_optimized;pub use stringify::default::stringify;pub use nodes::schema;pub use nodes::merge_patch;pub use parser::json5;
Modules§
- embedded
- Embedded systems utilities and helpers Embedded utilities module providing common patterns and helpers for embedded systems
- error
- Module defining error types and handling for JSON operations.
- file
- Module handling JSON file reading and writing operations
- io
- Module providing input/output operations for reading and writing JSON data
- macros
- Macros for convenient JSON construction Macros for convenient JSON construction
- misc
- Module containing utility functions and helpers for JSON processing Miscellaneous utility functions for JSON processing Contain functionality for version information and formatted JSON printing
- nodes
- Module containing JSON data structure definitions and node types
- parser
- Module implementing JSON parsing and value extraction Parser module for processing JSON data Implements parsing of JSON text into internal data structures Supports standard JSON types and syntax validation
- stringify
- Module for converting JSON structures to formatted strings
Macros§
- json
- Constructs a JSON value from a literal syntax