I think this update is quite significant and deserves a short description -
slices of non-primitive (integers, floats, booleans) elements, that is slices of structs, arrays, or slices are now represented differently in the report struct, returned by pub fn zonToStruct
.
They are now reflected with slices in the report struct, which are allocated dynamically, and the caller is responsible for deallocation.
The types of elements of these report slices depend on the type of the elements of the target struct slice counterparts.
If your target struct contains a slice of structs, expect a slice of matching structs in the report struct.
If your target struct contains a slice of arrays, you’re getting a slice of arrays in the report struct. Array elements type depend on the target array element type - if it’s a primitive type, you’ll get ZonFieldResult
elements. If it’s something more complex, then you’re getting a mirrored image of that.
If If your target struct contains a slice of arrays, you’re getting a slice of… something in the report struct. The type of that something once again depends on the type of elements of these nested slices in the target struct - if these are made of of primitive elements, then “something” is ZonFieldResult
enum. If it’s more complex… you get the idea.
See the examples in README.md, in examples
folder (same as in README). Also check out unit tests - see test "zonToStruct: Slice of structs"
, test "zonToStruct: Slice of arrays"
and test "zonToStruct: Slice of slices"
.