Cap'n Proto schemata and generated Rust code
There are different conventions on how to deal with autogenerated code like that produced by capnp:
- autogenerate the code on every build
- autogenerate the code once and commit it to version control
There are pros and cons to each approach, but for our use case, checking in the code is better for the following reasons:
- Users do not need to install
capnpas a build-time dependency - LSP/IDE tooling on the checked-in code works without configuration; it's rather verbose and hierarchical so tab-completion is a lifesaver
In the crate root directory, the command to compile a schema capnp/tag_server.capnp,
strip the prefix directory capnp, and put the resulting code in the src
directory, is the following:
capnp compile -orust:src --src-prefix=capnp capnp/tag_server.capnp