Closed XavDesbordes closed 2 months ago
IIRC you can convert the rkyv type into a boxed slice, and then Bytes from a boxed slice, without copies.
Any interest in making a PR?
That will be my first PR but yes definitely!
Just dug into AlignedVec implementation, converting the AlignedVec into a Boxed slice via into_boxed_slice reallocates, "This method reallocates and copies the underlying bytes. Any excess capacity is dropped.".
I will try something else.
Apparently, it works directly with the AlignedVec. Don't know why it failed, before.
Please forget that (non) issue
Looking at the code, I think there is a copy that shoul dbe avoided in the following code:
There is the serialization, which is fine and gives an
AlignedVec
that is then re-encoded a Bytes. The annoyance comes fromBytes::copy_from_slice(encoded.as_ref());
Is there a way to send the
AlignedVec
directly ?