Small serialization library for Rust

deltanedas 527db65c0a add test for u64 len 2 éve
orio-derive fbdde27687 LenIo gaming 2 éve
src 527db65c0a add test for u64 len 2 éve
.gitignore 574f41d36b first commit 3 éve
Cargo.toml 3f1a6a5606 ignore value of Len try_from error, lets u64 be used as Len 2 éve
LICENSE a0ef58e420 ready for publish 3 éve
README.md 25bfceb4b1 update readme 2 éve

README.md

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