fn as_io_slice<T>(data: &T) -> IoSlice<'_> {
    match mem::size_of::<T>() {
        0 => IoSlice::new(&[]),
        len => {
            let ptr = data as *const T as *const u8;
            let bytes = unsafe { slice::from_raw_parts(ptr, len) };
            IoSlice::new(bytes)
        }
    }
}
/// Returns an IoSlice (memory dump) of an arbitrary type.
Returns an IoSlice (memory dump) of an arbitrary type.
Returns an IoSlice ( memory dump ) of an arbitrary type .
fn as_io_slice<T>(data: &T) -> IoSlice<'_> {
    match mem::size_of::<T>() {
        0 => IoSlice::new(&[]),
        len => {
            let ptr = data as *const T as *const u8;
            let bytes = unsafe { slice::from_raw_parts(ptr, len) };
            IoSlice::new(bytes)
        }
    }
}
fn as_io_slice < T > ( data : & T ) -> IoSlice < ' _ > { match mem :: size_of :: < T > ( ) { 0 => IoSlice :: new ( & [ ] ) , len => { let ptr = data as * const T as * const u8 ; let bytes = unsafe { slice :: from_raw_parts ( ptr , len ) } ; IoSlice :: new ( bytes ) } } }
Returns an IoSlice (memory dump) of an arbitrary type.
Returns an IoSlice ( memory dump ) of an arbitrary type .
data
&T
data
&T