cddl-codegen icon indicating copy to clipboard operation
cddl-codegen copied to clipboard

Full recursive type support

Open rooooooooob opened this issue 3 years ago • 0 comments

As of #103 we have resolved dependency ordering (#93), but this, as before, still leads to recursive structures potentially being directly stack-allocated within the rust structs generated. This is not allowed in rust (since undefined sizes), so we've previously had to go in and insert some Box's in some spots (e.g. where they weren't already heap-allocated e.g. in a Vec or BTreeMap).

This is mostly here to document this limitation, but it's possible we could figure out where to insert these Boxs in a reasonable manner at code-gen time to avoid having to hand-edit it later.

rooooooooob avatar Oct 10 '22 21:10 rooooooooob