Crates.io | naive_json_io |
lib.rs | naive_json_io |
version | 0.1.0 |
source | src |
created_at | 2022-07-28 10:03:15.18885 |
updated_at | 2022-07-28 10:03:15.18885 |
description | naive_json_io is a library for loading and saving JSON data. naive_json_io is not for production. |
homepage | https://git.sr.ht/~veer66/naive_json_io |
repository | https://git.sr.ht/~veer66/naive_json_io |
max_upload_size | |
id | 634346 |
size | 7,126 |
naive_json_io
is a library for loading and saving JSON data. naive_json_io
is not for production.
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);
}