#file-extension #hexga #loading #save #save-file #convert #io #byte #abstraction #load

hexga_io

io file abstraction based on serde to allow loading/saving/converting bytes with a custom extension

12 releases

Uses new Rust 2024

0.0.10-beta.16 Jun 1, 2025
0.0.10-beta.13 May 29, 2025
0.0.10-beta.3 Apr 20, 2025

#846 in Encoding

Download history 133/week @ 2025-04-16 18/week @ 2025-04-23 1/week @ 2025-04-30 394/week @ 2025-05-07 155/week @ 2025-05-14 133/week @ 2025-05-21 498/week @ 2025-05-28 38/week @ 2025-06-04 13/week @ 2025-06-11 9/week @ 2025-06-18 25/week @ 2025-06-25

127 downloads per month
Used in 10 crates

MIT/Apache

87KB
1.5K SLoC

🚧 Warning: Experimental Crate! 🚧

This crate is currently in beta and experimental. It is subject to breaking changes in future releases. Use it at your own risk, and keep in mind that the API may change in future versions.

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 :

  • Simple to use
  • Allow to save composite file

Non Goal :

  • Async Loading (use some kind handle that will load it later instead, loading composite file async in a non blocking way is hard...)
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));

Main Hexga crate

Check hexga : https://crates.io/crates/hexga if you are interested in a quick start, it regroup multiple hexga crates.

Dependencies

~1.6–2.7MB
~54K SLoC