0.23 — Rc<Self> in RPC methods

28 Oct 2025

Today I have published version 0.23 of capnproto-rust on crates.io.

Since it was only yesterday that I published version 0.22, you may be wondering why I’m bumping the version number again so soon.

The answer is that @nivereno made a suggestion that was too good to ignore.

In 0.22, RPC methods got a &self parameter, but to make that work, we needed to add some complicated logic in the generated code, including some async/await that broke compatiblity with older Rust editions.

In 0.23, RPC methods instead get a self: Rc<Self> parameter. That ends up making the logic significantly simpler and lets us restore compabitibility with older Rust editions.

Moreover, the self: Rc<Self> parameter is generally more useful. In particular, it enables a long-desired feature in a natural way.

updating your code

This is, unfortunately, again a breaking change.

If you’ve already updated your code to 0.22, then you should just need to update your RPC method signatures. Because Rc<T> implements Deref<Target=T>, code in method bodies should for the most part not need to be updated.

If you have not updated to 0.22 yet, I recommend skipping that version and going straight from 0.21 to 0.23.

-- posted by dwrensha

capnproto-rust on github
more posts