capnproto / capnpc-rust

Cap'n Proto code generation for Rust
75 stars 26 forks source link

Importing schemas from other crates is awkward #30

Open dwrensha opened 7 years ago

dwrensha commented 7 years ago

If I write a sandstorm app using the low level cap'n proto API and I want to write some of my own schemas that refer to the sandstorm types, it currently does't work to just use https://crates.io/crates/sandstorm , because capnpc-rust has no awareness of cross-crate boundaries. Probably we need to use an annotation similar to https://github.com/sandstorm-io/capnproto/blob/2b8cde72a49492d26ac9809b490959b590a3cc7f/c%2B%2B/src/capnp/c%2B%2B.capnp#L25 .

dwrensha commented 7 years ago

rust.capnp might look something like this:

@0xe7d39f87b162dac5;

annotation filename(file): Text;
annotation crate(file): Text;
annotation module(file): Text;

Building hooks for such annotations into capnpc-rust would also solve #5.

dwrensha commented 1 year ago

This has been moved to https://github.com/capnproto/capnproto-rust/issues/233