capnpc-rust icon indicating copy to clipboard operation
capnpc-rust copied to clipboard

Importing schemas from other crates is awkward

Open dwrensha opened this issue 7 years ago • 2 comments

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 avatar Oct 16 '16 05:10 dwrensha

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 avatar Nov 16 '16 20:11 dwrensha

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

dwrensha avatar Jun 02 '23 16:06 dwrensha