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 be memcpy

Result:

  • Vec - Allocated with size equal to size_of::<data>.