[Feature Request] [proposal] Have the Writable
trait require a function that returns an estimate of the buffer size needed.
#4249
Labels
Review Mojo's priorities
What is your request?
Have the
Writable
trait require a function that returns an estimate of the buffer size needed. The function could return 0 in the case of datastructures that don't know it ahead of time.What is your motivation for this change?
Currently many uses of the writer API look like this:
One either has to know the exact size of each component or guess sizes. These calculations aren't of any use when the type's
write_to
function gets called without reserving it that way.Any other details?
This change will be useful for:
CC: @jackos
The text was updated successfully, but these errors were encountered: