Function wraited_struct::write[][src]

pub unsafe fn write<T, W: Write>(writer: &mut W, value: T) -> Result<usize>

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();
}