Enum binread::error::Error [−][src]
#[non_exhaustive]
pub enum Error {
BadMagic {
pos: u64,
found: Box<dyn Any + Sync + Send>,
},
AssertFail {
pos: u64,
message: String,
},
Io(Error),
Custom {
pos: u64,
err: Box<dyn Any + Sync + Send>,
},
NoVariantMatch {
pos: u64,
},
EnumErrors {
pos: u64,
variant_errors: Vec<(&'static str, Error)>,
},
}
Expand description
An error while parsing a BinRead type
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
The magic value did not match the provided one
The condition of an assertion without a custom type failed
An error that occured while reading from, or seeking within, the reader
Tuple Fields of Io
0: Error
A custom error, most often given from the second value passed into an assert
No variant in the enum was successful in parsing the data
Fields of NoVariantMatch
pos: u64
Implementations
Gets a custom error of type T from the Error. Returns None
if the error type is not
custom or if the contained error is not of the desired type.