#json #test #naive #data #production #loading #saving

naive_json_io

naive_json_io is a library for loading and saving JSON data. naive_json_io is not for production.

1 unstable release

0.1.0 Jul 28, 2022

#12 in #saving

MIT license

4KB

naive_json_io is a library for loading and saving JSON data. naive_json_io is not for production.

Example

use serde_derive::{Serialize, Deserialize};
use naive_json_io;

#[derive(Serialize, Deserialize)]
struct A {
    b: String,
    c: u32
}

fn main() {
    let to_be_saved_a = A { b: String::from("B"), c: 10 };
    naive_json_io::save(&to_be_saved_a, "/tmp/save_a.json");
    let loaded_a: A = naive_json_io::load("/tmp/save_a.json");
    naive_json_io::print(&loaded_a);    
}

Dependencies

~0.7–1.6MB
~35K SLoC