write-json

Crates.iowrite-json
lib.rswrite-json
version0.1.4
sourcesrc
created_at2020-08-01 02:09:14.298529
updated_at2023-12-31 11:29:35.513211
descriptionSimple {dependency,trait,macro}-less JSON serialization
homepage
repositoryhttps://github.com/matklad/write-json
max_upload_size
id271825
size20,427
owners (github:badrobotics:owners)

documentation

README

write-json

Simple {dependency,trait,macro}-less JSON serialization

let mut buf = String::new();

{
    let mut obj = write_json::object(&mut buf);
    obj.string("name", "Peter").number("favorite number", 92.0);
    obj.array("films")
        .string("Drowning By Numbers")
        .string("A Zed & Two Noughts");
    obj.null("suitcase");
}

assert_eq!(
    buf,
    r#"{"name":"Peter","favorite number":92,"films":["Drowning By Numbers","A Zed & Two Noughts"],"suitcase":null}"#
)
Commit count: 6

cargo fmt