Function read_struct

Source
pub unsafe fn read_struct<T: Copy, F: Read>(
    f: &mut F,
    out: &mut T,
) -> Result<(), Error>
Expand description

Reads a struct from an input buffer. This is unsafe because the struct is initialized to unverified data read from the input. read_struct should only be called to fill plain old data structs. It is not endian safe.

ยงArguments

  • f - The input to read from. Often this is a file.
  • out - The struct to fill with data read from f.