bare_proc 0.2.0

A proc macro to generate Rust types from a BARE schema file.
Documentation

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.