JSON in Rust
Parse and serialize JSON with ease.
Complete Documentation - Cargo - Repository
Why?
JSON is a very loose format where anything goes - arrays can hold mixed types, object keys can change types between API calls or not include some keys under some conditions. Mapping that to idiomatic Rust structs introduces friction.
This crate intends to avoid that friction by extensively using static dispatch and hiding type information behind enums, while still giving you all the guarantees of safe Rust code.
let data = parse.unwrap;
assert!;
assert!;
assert!;
assert!;
assert!;
// Error resilient: non-existent values default to null
assert!;
Easily create JSON data without defining structs
extern crate json;
Installation
Just add it to your Cargo.toml
file:
[]
= "*"
Then import it in your main.rs
/ lib.rs
file:
extern crate json;