io.rs 249 B

123456789101112
  1. use std::io::Result;
  2. pub use byteorder::{ReadBytesExt, WriteBytesExt};
  3. pub type Reader<'a> = &'a [u8];
  4. pub type Writer = Vec<u8>;
  5. pub trait Io : Sized {
  6. fn read(r: &mut Reader) -> Result<Self>;
  7. fn write(&self, w: &mut Writer) -> Result<()>;
  8. }