Hi Emyr,
You can use capnp::writeMessage() to write to any kind of stream.
https://github.com/capnproto/capnproto/blob/7e2f70f354e2ca3d9de73ddaf974408ddbd98866/c++/src/capnp/serialize.h#L162
This function writes to a `kj::OutputStream`, which is an abstract
interface that you can implement any w
If you have a struct Foo whose fields are a strict superset of some other
struct Bar (with matching field numbers and everything), then you can
convert one to the other like:
Foo::Reader foo = ...;
Bar::Reader bar = capnp::AnyStruct::Reader(foo).as();
(Or vice versa.)
But the big problem