dicom-rs
dicom-rs copied to clipboard
[encoding] Extend TextCodec with decode_to and encode_to
This extends the TextCodec
trait to also have encode_to
and decode_to
methods, which take a heap allocated buffer value instead of returning a new one. This makes it possible to reduce the number of allocations needed in some cases.
It is a breaking change because the trait is not sealed and implementations are required to provide definitions for these new methods.
I will put this on hold until attempts are made to integrate with new text encoding libraries.
Closing because I'm not sure this is the right direction for text encoding/decoding, and it's gone far behind by other changes.