gc_gcm/error.rs
1#[cfg(not(feature = "no_std"))]
2use std::io;
3
4/// An error resulting from parsing or opening a GcmFile
5#[derive(Debug)]
6pub enum GcmError {
7 ParseError(binread::Error),
8
9 #[cfg(not(feature = "no_std"))]
10 IoError(std::io::Error),
11}
12
13#[cfg(not(feature = "no_std"))]
14impl From<io::Error> for GcmError {
15 fn from(err: io::Error) -> Self {
16 GcmError::IoError(err)
17 }
18}
19
20impl From<binread::Error> for GcmError {
21 fn from(err: binread::Error) -> Self {
22 GcmError::ParseError(err)
23 }
24}