| Crates.io | hexga_io_derive |
| lib.rs | hexga_io_derive |
| version | 0.0.11-beta.3 |
| created_at | 2025-05-29 22:15:44.720273+00 |
| updated_at | 2025-08-12 19:04:34.63974+00 |
| description | hexga_io derive macro |
| homepage | https://github.com/Thomas-Mewily/hexga |
| repository | https://github.com/Thomas-Mewily/hexga |
| max_upload_size | |
| id | 1694451 |
| size | 6,883 |
The derive macro for Hexga Io.
Check hexga_io :
Io file abstraction based on serde to allow loading/saving and converting bytes.
Is support custom user define extension and convertion, and it also support common markup extension (json, ron, xml...).
Goal :
Non Goal :
use hexga_io::prelude::*;
"Hello file !".save_to_disk("./myfile.txt").unwrap();
let read = String::load_from_disk("./myfile.txt").unwrap();
assert_eq!("Hello file !", read);
// #[io] derive (serde::Serdialize, serde::Deserialize) and (hexga_io::Load, hexga_io::Save)
#[io]
#[derive(PartialEq, Debug)]
struct Person
{
age : i32,
name : String,
}
let mut fs = IoFsDisk::new();
let person = Person { age: 42, name: "Life".to_owned() };
person.save_to("./person.json", &mut fs).unwrap();
person.save_to("./person.ron" , &mut fs).unwrap();
fs.commit().unwrap();
assert_eq!(Person::load_from_disk("./person.ron"), Ok(person));
Check hexga : https://crates.io/crates/hexga if you are interested in a quick start, it regroup multiple hexga crates.