Expand description
§RSON Core
Core parsing and value types for RSON (Rust Serialized Object Notation).
RSON is a human-readable data serialization format designed as a superset of JSON, with support for richer data structures like enums, structs, tuples, and optionals.
§Features
- JSON Compatibility: Any valid JSON is valid RSON
- Rich Types: Structs, enums, tuples, optionals beyond JSON’s types
- Developer-Friendly: Comments, trailing commas, unquoted identifiers
- Efficient: Zero-copy parsing where possible
§Example
// Example RSON document
User(
id: 1,
name: "Dedan",
email: Some("dedan@example.com"),
roles: ["admin", "editor"],
settings: {
theme: "dark",
notifications: true,
},
)Re-exports§
pub use value::RsonValue;pub use value::RsonType;pub use parser::parse_rson;pub use parser::parse_rson_value;pub use error::RsonError;pub use error::RsonResult;pub use formatter::format_rson;pub use formatter::format_pretty;pub use formatter::format_compact;pub use formatter::Formatter;pub use formatter::FormatOptions;
Modules§
- error
- Error types for RSON parsing and processing.
- formatter
- RSON formatter for converting
RsonValueback to text. - parser
- RSON parser implementation using nom.
- value
- RSON value types and data model.