| Crates.io | haxeformat |
| lib.rs | haxeformat |
| version | 0.2.3 |
| created_at | 2020-05-11 14:26:08.050974+00 |
| updated_at | 2023-04-04 18:11:49.323497+00 |
| description | Haxe serialization format in Rust |
| homepage | |
| repository | https://gitlab.com/eternal-twin/tools/haxeformat |
| max_upload_size | |
| id | 240128 |
| size | 147,901 |
Rust implementation of the Haxe serialization format, with serde support.
use serde::{ Serialize, Deserialize };
#[derive(Debug, Eq, PartialEq, Serialize, Deserialize)]
struct Person {
name: String,
surname: String,
age: u32,
}
let person = Person { name: "John".to_owned(), surname: "Doe".to_owned(), age: 42 };
let serialized = "oy4:namey4:Johny7:surnamey3:Doey3:agei42g";
assert_eq!(haxeformat::from_str::<Person>(serialized).unwrap(), person);
assert_eq!(haxeformat::to_string::<Person>(&person).unwrap(), serialized);