pub enum ModuleError {
NotAModule,
Version(Version),
Feature(u32),
Truncated {
expected: u64,
actual: u64,
},
TrailingBytes {
expected: u64,
actual: u64,
},
HeaderChecksum {
computed: u32,
stored: u32,
},
SectionChecksum {
id: u32,
computed: u32,
stored: u32,
},
UnknownSection(u32),
MissingSection(u32),
Malformed {
section: &'static str,
offset: usize,
reason: String,
},
}Variants§
NotAModule
The file does not start with the magic.
Version(Version)
A format version this reader does not read (§8.1).
Feature(u32)
Required feature bits this reader does not know.
Truncated
The file is shorter than its header, or than the length its header gives.
TrailingBytes
The file is longer than the length its header gives.
HeaderChecksum
SectionChecksum
UnknownSection(u32)
A section id this reader does not know, without the optional flag.
MissingSection(u32)
Malformed
offset counts from the start of the file in the header and table, else of the section body.
Trait Implementations§
Source§impl Clone for ModuleError
impl Clone for ModuleError
Source§impl Debug for ModuleError
impl Debug for ModuleError
Source§impl Display for ModuleError
impl Display for ModuleError
impl Eq for ModuleError
Source§impl Error for ModuleError
impl Error for ModuleError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for ModuleError
impl PartialEq for ModuleError
impl StructuralPartialEq for ModuleError
Auto Trait Implementations§
impl Freeze for ModuleError
impl RefUnwindSafe for ModuleError
impl Send for ModuleError
impl Sync for ModuleError
impl Unpin for ModuleError
impl UnsafeUnpin for ModuleError
impl UnwindSafe for ModuleError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more