fn as_bytes<T, U, F: FnOnce(&[&[u8]]) -> U>(data: &T, f: F) -> U {
        let len = mem::size_of::<T>();
        match len {
            0 => f(&[]),
            len => {
                let p = data as *const T as *const u8;
                let bytes = unsafe { slice::from_raw_parts(p, len) };
                f(&[bytes])
            }
        }
    }
/// Serialize an arbitrary type to bytes (memory copy, useful for fuse_*_out types)
Serialize an arbitrary type to bytes (memory copy, useful for fuse_*_out types)
Serialize an arbitrary type to bytes ( memory copy useful for fuse_ * _out types )
fn as_bytes<T, U, F: FnOnce(&[&[u8]]) -> U>(data: &T, f: F) -> U {
        let len = mem::size_of::<T>();
        match len {
            0 => f(&[]),
            len => {
                let p = data as *const T as *const u8;
                let bytes = unsafe { slice::from_raw_parts(p, len) };
                f(&[bytes])
            }
        }
    }
fn as_bytes < T , U , F : FnOnce ( & [ & [ u8 ] ] ) -> U > ( data : & T , f : F ) -> U { let len = mem :: size_of :: < T > ( ) ; match len { 0 => f ( & [ ] ) , len => { let p = data as * const T as * const u8 ; let bytes = unsafe { slice :: from_raw_parts ( p , len ) } ; f ( & [ bytes ] ) } } }
Serialize an arbitrary type to bytes (memory copy, useful for fuse_*_out types)
Serialize an arbitrary type to bytes ( memory copy useful for fuse_ * _out types )
data
&T
f
F
data
&T
f
F