Crates.io | bare_proc |
lib.rs | bare_proc |
version | 0.2.0 |
source | src |
created_at | 2024-04-21 17:33:12.310166 |
updated_at | 2024-04-22 00:47:03.740009 |
description | A proc macro to generate Rust types from a BARE schema file. |
homepage | https://git.sr.ht/~chiefnoah/bare_proc |
repository | https://git.sr.ht/~chiefnoah/bare_proc |
max_upload_size | |
id | 1215550 |
size | 27,066 |
bare_proc
is a proc-macro that implements a parser-generator for the
BARE message format.
It relies on serde
using
serde_bare
to implement serialization.
Define you BARE schema in a .bare file:
type User struct {
name: str
key: data[128]
id: uint
}
Then in a corresponding Rust file:
bare_schema!("schema.bare");
which will expand roughly the following:
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug)]
struct User {
name: String,
key: Vec<u8>,
id: u64,
}
bare_proc
is licensed under MIT.