orio

Crates.ioorio
lib.rsorio
version0.5.3
sourcesrc
created_at2023-11-01 05:41:42.303438
updated_at2024-05-13 10:11:16.249021
descriptionSmall serialization library
homepage
repositoryhttps://gitgud.io/deltanedas/orio
max_upload_size
id1020639
size22,355
(deltanedas)

documentation

README

Orio

Lightweight and clean alternative to serde, focusing on writing to and from Vec<u8>s.

#[derive(Io)]
struct Thingy {
	#[io(len(u16))]
	name: String,
	kind: ThingyKind,
	#[io(ignore)]
	debug: String
}

#[derive(Io)]
enum ThingyKind {
	Normal,
	Special(#[io(len(u8))] String)
}

let thingy = Thingy {
	name: "thing".to_owned(),
	kind: ThingyKind::Normal,	
	debug: "not written".to_owned()
}
let mut bytes = vec![];
thingy.write(&mut bytes);

Under the hood its a generic wrapper over little-endian byteorder with a derive macro for structs and enums to use.

Named after the cookie :)

License

MIT license

Commit count: 0

cargo fmt