pub unsafe fn read<T, R: Read>(reader: &mut R) -> Result<T>Expand description
Read T with byte array
ยงExample
extern crate wraited_struct;
use std::fs::File;
#[derive(Debug)]
struct Something {
a: u8,
b: u16,
c: u32,
}
fn main() {
let mut file = File::open("something.bin").unwrap();
let something = wraited_struct::read::<Something, File>(&mut file).unwrap();
println!("{:?}", something);
}