Small serialization library for Rust

deltanedas a5ef26751b update derive %!s(int64=2) %!d(string=hai) anos
orio-derive 01c9ee7df6 add #[automatically_derived] for IO %!s(int64=2) %!d(string=hai) anos
src da37a2b9cd add support for tuples with 1-6 items %!s(int64=2) %!d(string=hai) anos
.gitignore 574f41d36b first commit %!s(int64=3) %!d(string=hai) anos
Cargo.toml a5ef26751b update derive %!s(int64=2) %!d(string=hai) anos
LICENSE a0ef58e420 ready for publish %!s(int64=3) %!d(string=hai) anos
README.md 25bfceb4b1 update readme %!s(int64=2) %!d(string=hai) anos

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