pgrx
pgrx copied to clipboard
A safe ArrayBuilder atop RawArray
Or more like ArrayValidator, perhaps: a builder that accomplishes the correct steps to construct a fully safe handle on RawArray, validating all the various assumptions that we have embedded in our code before actually yielding the handle for the type.
Such a thing is part of why most of the existing functions on RawArray for getting slices are &mut
: I intend to use them in such a pattern, where the ArrayBuilder's functions return &mut ArrayBuilder
.
If such a builder was made, would it be the only way to construct a RawArray? Or would it come with an asterisks of "You can do this directly if you know what you're doing. If you dont, then use the builder"?
It would be a RawArray -> ArrayBuilder -> SomeOtherType (possibly current Array, possibly something else).