#T.to_bytes() without cloning the data?
32 messages · Page 1 of 1 (latest)
Not all types can be converted to bytes so you're gonna have to be more specific.
Any of the to_*_bytes functions.
who'd own the bytes?
what endianness do you want the bytes to be?
why are you doing this in the first place?
the one receiving the result of the to_bytes
writing a db
So... You want serialization?
idk what that means
anyways even if it includes unsafe is there no way to turn a type to raw bytes without cloning it?
What's wrong with the to_*_bytes functions
?crate bytemuck
?crate rkyv
which one would you say is better?
They are for different uses
thanks
they're mostly for inspiration
if you investigate fully what they offer then you will know a lot more how you want to approach your program
but you might want to use them directly
so youre saying i should make my own implementation of them?
not necessarily, but if you're gonna be writing a db engine you will probably eventually write your own serialization traits