Function lazy_bytes_cast::copy_to_bytes
[−]
[src]
pub fn copy_to_bytes<T: Copy>(data: T, to: &mut [u8]) -> Result<(), ()>
Converts data to a byte array by writing it into mutable slice
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
to
- Byte slice where to copy
Result:
Ok
- Success.Err
- Insufficient slice size.