Closed novacrazy closed 7 years ago
I suppose I could have opened this in the runtime library repo, but since this more has to do with the generated Builder code, eh.
Thanks for the report! This should be fixed in https://github.com/dwrensha/capnpc-rust/commit/c248530330162d1876e38f99bb85c70b7a7015a8.
An alternative could be a way to create a list builder without a parent somehow? Then I could just use set_some, but I don't see an obvious way of doing that.
Yeah, this would require orphans: https://github.com/dwrensha/capnproto-rust/issues/51
Thanks for the quick fix! Everything seems to be working now.
I have in my capnp files an union that is akin to Rust's
Option
type:And I use it to store a
List
like:And the generated documentation looks like:
However, it seems that the
initn_some
method doesn't do anything, as when I try to read back in the data it shows up asNone
.You can see Here how I am initializing the builder and attempting to copy the data into it.
And it executes just fine, and all data but the
Option(List(_))
types appear to save perfectly.So is it a bug that Lists inside union types cannot be properly initialized or am I doing it wrong?
Also,
set_vector
is defined in this file. It's nothing much.An alternative could be a way to create a list builder without a parent somehow? Then I could just use
set_some
, but I don't see an obvious way of doing that.