pub unsafe fn write<T, W: Write>(writer: &mut W, value: T) -> Result<usize>Expand description
Write T with byte array
ยงExample
extern crate wraited_struct;
use std::fs::File;
struct Something {
a: u8,
b: u16,
c: u32,
}
fn main() {
let mut file = File::create("something.bin").unwrap();
wraited_struct::write::<Something, File>(&mut file, Something { a: 97, b: 98, c: 99 }).unwrap();
}