pub struct ParseError {
pub field: String,
pub reason: String,
}
Expand description
Error information for non-fatal parsing failures.
When parsing SDRR firmware, some sections may fail to parse due to corruption, invalid pointers, or other issues. Rather than failing the entire parse operation, these errors are collected and reported while the parser continues with other sections.
§Examples
let error = ParseError {
field: "build_date".to_string(),
reason: "Invalid pointer: 0xFFFFFFFF".to_string(),
};
Fields§
§field: String
The field or structure that failed to parse.
Examples:
"build_date"
- Build date string"hw_rev"
- Hardware revision string"rom_set[0]"
- First ROM set"rom_set[1].roms[2]"
- Third ROM in second ROM set"pins"
- Pin configuration structure
reason: String
Human-readable description of why parsing failed.
Examples:
"Invalid pointer: 0xFFFFFFFF"
"String not null-terminated within bounds"
"ROM data extends past end of firmware"
"Unsupported ROM type value: 255"
Implementations§
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ParseError
impl Debug for ParseError
Source§impl<'de> Deserialize<'de> for ParseError
impl<'de> Deserialize<'de> for ParseError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ParseError
impl Display for ParseError
Source§impl PartialEq for ParseError
impl PartialEq for ParseError
Source§impl Serialize for ParseError
impl Serialize for ParseError
impl Eq for ParseError
impl StructuralPartialEq for ParseError
Auto Trait Implementations§
impl Freeze for ParseError
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnwindSafe for ParseError
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