Small serialization library for Rust
|
|
2 роки тому | |
|---|---|---|
| orio-derive | 2 роки тому | |
| src | 2 роки тому | |
| .gitignore | 3 роки тому | |
| Cargo.toml | 2 роки тому | |
| LICENSE | 3 роки тому | |
| README.md | 3 роки тому |
Lightweight and clean alternative to serde, focusing on writing to and from Vec<u8>s.
#[derive(Io)]
struct Thingy {
name: String,
kind: ThingyKind,
#[io(ignore)]
debug: String
}
#[derive(Io)]
enum ThingyKind {
Normal,
Special(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 :)