Small serialization library for Rust

deltanedas 6768d38b2f fix doc nitpicks 3 tuần trước cách đây
orio-derive 7df4293cd2 fix scope 3 tuần trước cách đây
src 6768d38b2f fix doc nitpicks 3 tuần trước cách đây
.gitignore 574f41d36b first commit 3 năm trước cách đây
Cargo.toml 6768d38b2f fix doc nitpicks 3 tuần trước cách đây
LICENSE 7b318563ab update things 1 tháng trước cách đây
README.md 7b318563ab update things 1 tháng trước cách đây

README.md

Orio

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

MSRV is 1.85.0

#[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)?;
// can also write thingy.write_to_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