/// Get slice of bytes representing a given object.
Get slice of bytes representing a given object.
Get slice of bytes representing a given object .
pub fn as_bytes<'a, T: Sized>(val: &'a T) -> &'a [u8] {
    let ptr  = val as *const T;
    let size = mem::size_of::<T>();
    unsafe {
        slice::from_raw_parts(ptr as *const u8, size)
    }
}
pub fn as_bytes < ' a , T : Sized > ( val : & ' a T ) -> & ' a [ u8 ] { let ptr = val as * const T ; let size = mem :: size_of :: < T > ( ) ; unsafe { slice :: from_raw_parts ( ptr as * const u8 , size ) } }
Get slice of bytes representing a given object.
Get slice of bytes representing a given object .
val
&'a T