unsafe fn read_struct<T: Copy>(fd: &mut File) -> io::Result<T>
{
    let mut ret: T = std::mem::zeroed();
    fd.read_exact(std::slice::from_raw_parts_mut(
            &mut ret as *mut _ as *mut u8,
            std::mem::size_of_val(&ret)))?;
    Ok(ret)
}
/// Read a structure from a file stream, directly interpreting the raw bytes
/// of the file as T.
///
/// User must make sure the shape of the structure `T` is safe to use in this
/// way, hence being unsafe.
Read a structure from a file stream, directly interpreting the raw bytes
of the file as T.

User must make sure the shape of the structure `T` is safe to use in this
way, hence being unsafe.
Read a structure from a file stream directly interpreting the raw bytes of the file as T . User must make sure the shape of the structure ` T ` is safe to use in this way hence being unsafe .
unsafe fn read_struct<T: Copy>(fd: &mut File) -> io::Result<T>
{
    let mut ret: T = std::mem::zeroed();
    fd.read_exact(std::slice::from_raw_parts_mut(
            &mut ret as *mut _ as *mut u8,
            std::mem::size_of_val(&ret)))?;
    Ok(ret)
}
unsafe fn read_struct < T : Copy > ( fd : & mut File ) -> io :: Result < T > { let mut ret : T = std :: mem :: zeroed ( ) ; fd . read_exact ( std :: slice :: from_raw_parts_mut ( & mut ret as * mut _ as * mut u8 , std :: mem :: size_of_val ( & ret ) ) ) ? ; Ok ( ret ) }
Read a structure from a file stream, directly interpreting the raw bytes
of the file as T.
Read a structure from a file stream directly interpreting the raw bytes of the file as T .
fd
&mut File
fd
&mut File