Converting AnyStruct to DynamicStruct

6 views
Skip to first unread message

Vaci

unread,
Nov 30, 2021, 3:54:18 PM11/30/21
to Cap'n Proto
Apologies if there is an obvious answer, but f I have a capnp::StructSchema, and a capnp::AnyStruct::Reader, then can I create a capnp::DynamicStruct::Reader from them, and if so, how?

Thanks
Vaci

Kenton Varda

unread,
Nov 30, 2021, 3:57:20 PM11/30/21
to Vaci, Cap'n Proto
Hi Vaci,

`anyReader.as<capnp::DynamicStruct>(structSchema)` should do it.

-Kenton

--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/1de9997d-b015-4ce8-bf32-bf08dce167f4n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages