Ability to serialize to a stream #400
Replies: 1 comment
-
Thanks so much for sharing your use case. We initially had streaming support, but it made the code much more complicated. We'll probably add it back at some point, but I don't expect it to be in the near future. I would recommend sharing your buffer as much as possible so that you don't end up with multiple large buffers in your code. Using static here was a good choice. I plan to look more at using I'll make an issue about |
Beta Was this translation helpful? Give feedback.
-
Presuming that
radio.cfg_
is a structure that I have appropriately configured for glaze with meta information I can make a pretty niceset
function in my embedded device REPL.Something like:
But a
get
function is a little harder. I don't see a way to write to a stream, so I have to resort to some arbitrarily large static bufferI tried wrapping our custom
io::OutDevice
class (just a UART virtual interface) with a simple output iterator but glaze concepts want either a "range" (defined by havingbegin
andend
) or a raw buffer.Let me know if this is out of scope, since I know streams are not the most performant solution. But on small embedded platforms a stream is often the best solution to limit RAM use and stack size.
Beta Was this translation helpful? Give feedback.
All reactions