naive_json_io

Crates.ionaive_json_io
lib.rsnaive_json_io
version0.1.0
sourcesrc
created_at2022-07-28 10:03:15.18885
updated_at2022-07-28 10:03:15.18885
descriptionnaive_json_io is a library for loading and saving JSON data. naive_json_io is not for production.
homepagehttps://git.sr.ht/~veer66/naive_json_io
repositoryhttps://git.sr.ht/~veer66/naive_json_io
max_upload_size
id634346
size7,126
Vee Satayamas (veer66)

documentation

README

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);    
}
Commit count: 0

cargo fmt