Skip to content

Commit 58977b7

Browse files
committed
Add information to capnp-rpc/README.md about importing generated code
1 parent f1717d7 commit 58977b7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

capnp-rpc/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,18 @@ fn main() {
3939
}
4040
```
4141

42-
and you can include the generated code in your project like this:
42+
Such a command generates a `foo_capnp.rs` file in the `OUT_DIR`
43+
directory provided by `cargo`.
44+
45+
To import the generated code, add a line like this at the root of your crate:
4346

4447
```rust
4548
capnp::generated_code!(pub mod foo_capnp);
4649
```
4750

51+
(If you want to import the code at a non-toplevel module location, then you will
52+
need to use the `$Rust.parentModule` annotation, defined in `rust.capnp`.)
53+
4854
## Calling methods on an RPC object
4955

5056
For each defined interface, the generated code includes a `Client` struct

0 commit comments

Comments
 (0)