[−][src]Enum pelite::Error
Errors while parsing the PE binary.
Variants
Null address.
Out of bounds.
Catch-all for bounds check errors.
Data is not available.
Can happen when referencing data in PeFile
instances.
Sections can be shorter than stored on disk, the remaining bytes will default to zeroes when loaded by the system. Since these zeroes would just be a waste of space, they are not present in the binaries on disk. This error happens when attempting to get a reference to such zero filled data.
Data is not available.
Can happen when referencing data in PeView
instances.
Sections can have excess in their raw data which won't be mapped when loaded by the system. This error happens when attempting to get a reference to such unmapped raw data. Sometimes this kind of excess is called an overlay.
Address is misaligned.
Expected magic number does not match.
Trying to load a PE32 file with a PE32+ parser or vice versa.
Sanity check failed.
Some value was so far outside its typical range, while not technically incorrect, probably indicating something went wrong. If this error is encountered legitimately, create an issue or file a PR to relax the artificial restrictions.
Invalid data.
Structured data was found which simply isn't valid. Catch-all for errors which don't fall under other errors.
Overflow error.
Catch-all for overflow and underflow errors.
Encoding error.
Catch-all for string related errors such as lacking a nul terminator.
Methods
impl Error
[src]
pub fn is_null(self) -> bool
[src]
Returns if the error variant is Null.
Useful in match guards where Null
should be handled as a non-error case.
fn with_default(result: pelite::Result<i32>) -> pelite::Result<i32> { let i = match result { Ok(i) => i, // Avoids a more verbose comparison with pelite::Error::Null Err(err) if err.is_null() => 0, Err(err) => return Err(err), }; Ok(i) } assert_eq!(with_default(Err(pelite::Error::Null)), Ok(0));
Trait Implementations
impl Clone for Error
[src]
impl Copy for Error
[src]
impl Debug for Error
[src]
impl Display for Error
[src]
impl Eq for Error
[src]
impl Error for Error
[src]
fn description(&self) -> &str
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl From<Error> for FindError
[src]
impl Hash for Error
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Error> for Error
[src]
impl Serialize for Error
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Error
[src]
impl StructuralPartialEq for Error
[src]
Auto Trait Implementations
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,