serde icon indicating copy to clipboard operation
serde copied to clipboard

Support for ReadOnlyMemory<byte>

Open AlgorithmsAreCool opened this issue 7 months ago • 2 comments

I noticed that there is serializer support for byte[], but having support for ROM<byte> would help a few cases, notably on the serialization side, i could rent the buffers, fill them with data and then serialize them and returns the buffers. If i try that with an array, i might get back a oversized array and then serialize extra data.

On the deserialization side, the proxy could just allocate arrays to create the ROMs and that would be fine. A more advanced usecase for way down the road would be the abiliity to specify buffer allocators to the serde infra.

But as for the ROM support, could i raise a PR for it if you think a built in proxy is a good idea?

AlgorithmsAreCool avatar Jun 04 '25 19:06 AlgorithmsAreCool

Yup seems good to me. Feel free to PR it. I think just an additional proxy, plus wiring it up to the generator, should be good enough

agocke avatar Jun 04 '25 23:06 agocke

I'll give it a shot in the next day or two

AlgorithmsAreCool avatar Jun 05 '25 00:06 AlgorithmsAreCool