Greetings!
Trying to understand how to work with output spans. I noticed this WWDC session showcases the use of:
let pixelData = Data(rawCapacity: totalBytes) { outputSpan in
Which does not seem to exist in Foundation as of 6.2.
The same example in Swift Binary Parsing has:
// TODO: Use OutputRawSpan instead of Data
var pixelData = Data(capacity: header.pixelCount * channels)
Which leads me to believe the feature didn’t make the cut.
Does anyone know of a work-around way of obtaining a OutputRawSpan that does not involve unsafe code?
Is there another safe and efficient way to output serialized binary representations of Swift structs?
Thanks!