Currently, to construct an array record, you have to pass in an array of records. This is inconvenient in some cases.
For each array record R, we should add functions to start R, to add an element to R, and to finish R. We will need a state machine so that, for example, attempting to serialize a different kind of record while in the "adding elements to R" state causes an error. Starting a record R should fail if there is not enough room to hold the metadata for R. Adding an element should fail if there is not enough room to hold the element. If a container is sent in the "adding elements to R" state, then R should be implicitly finished before sending.
Currently, to construct an array record, you have to pass in an array of records. This is inconvenient in some cases.
For each array record R, we should add functions to start R, to add an element to R, and to finish R. We will need a state machine so that, for example, attempting to serialize a different kind of record while in the "adding elements to R" state causes an error. Starting a record R should fail if there is not enough room to hold the metadata for R. Adding an element should fail if there is not enough room to hold the element. If a container is sent in the "adding elements to R" state, then R should be implicitly finished before sending.