Function lazy_bytes_cast::to_bytes
[−]
[src]
pub fn to_bytes<T: Copy>(data: T) -> Vec<u8>
Converts data to a byte array.
Note:
This function limits its usage to data that implements marker::Copy
But it does not guarantee that all types with such trait will be correctly converted.
Parameters:
data
- Arbitrary data that can bememcpy
Result:
Vec
- Allocated with size equal tosize_of::<data>
.