lib.rs 442 B

12345678910111213141516171819
  1. use std::io::{Error, ErrorKind};
  2. mod io;
  3. mod impls;
  4. #[cfg(test)]
  5. mod tests;
  6. #[cfg(feature = "derive")]
  7. pub use orio_derive::*;
  8. pub use crate::io::*;
  9. pub(crate) use byteorder::LittleEndian as LE;
  10. /// Helper for enum [Io::read] implementations to use.
  11. #[cfg(feature = "derive")]
  12. pub fn derive_enum_variant_error(variant: usize, ident: &str) -> Error {
  13. Error::new(ErrorKind::Other, format!("Invalid enum variant {variant} for {ident}"))
  14. }