bare_proc

Crates.iobare_proc
lib.rsbare_proc
version0.2.0
sourcesrc
created_at2024-04-21 17:33:12.310166
updated_at2024-04-22 00:47:03.740009
descriptionA proc macro to generate Rust types from a BARE schema file.
homepagehttps://git.sr.ht/~chiefnoah/bare_proc
repositoryhttps://git.sr.ht/~chiefnoah/bare_proc
max_upload_size
id1215550
size27,066
Noah Pederson (chiefnoah)

documentation

https://docs.rs/bare_proc/0.1.1/bare_proc/

README

bare_proc

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.

Usage

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,
}

License

bare_proc is licensed under MIT.

Commit count: 0

cargo fmt