Reading messages dynamically without capnpc generation
I'm trying to read Cap'n Proto messages where the schema is only known at runtime. capnproto-c++ does support runtime schema loading, but capnproto-rust does not.
The examples always start with a type from capnpc-generated code and then downcast to dynamic_value, dynamic_struct, etc., but there is no way to get there from a capnp::message::Reader.
Same goes for creating messages based on dynamic_value etc..
It would be great to have this feature added.
No, capnproto-rust currently does not support that. The dynamic reflection API requires any schemas that are used to be known at compile time.
If you are willing to use C++, capnproto-c++ does support runtime schema loading: https://github.com/capnproto/capnproto/blob/v2/c%2B%2B/src/capnp/schema-loader.h
Unfortunately, using C++ is not an option (I have to support wasm, where mixing Rust and C++ is hard to impossible). Is there any chance that this will be added?
I've updated the ticket to represent a feature request rather than a question.