pub enum LnmpError {
Show 16 variants
InvalidCharacter {
char: char,
line: usize,
column: usize,
},
UnterminatedString {
line: usize,
column: usize,
},
UnexpectedToken {
expected: String,
found: Token,
line: usize,
column: usize,
},
InvalidFieldId {
value: String,
line: usize,
column: usize,
},
InvalidValue {
field_id: u16,
reason: String,
line: usize,
column: usize,
},
InvalidChecksum {
field_id: u16,
reason: String,
line: usize,
column: usize,
},
UnexpectedEof {
line: usize,
column: usize,
},
InvalidEscapeSequence {
sequence: String,
line: usize,
column: usize,
},
StrictModeViolation {
reason: String,
line: usize,
column: usize,
},
TypeHintMismatch {
field_id: u16,
expected_type: String,
actual_value: String,
line: usize,
column: usize,
},
InvalidTypeHint {
hint: String,
line: usize,
column: usize,
},
ChecksumMismatch {
field_id: u16,
expected: String,
found: String,
line: usize,
column: usize,
},
NestingTooDeep {
max_depth: usize,
actual_depth: usize,
line: usize,
column: usize,
},
InvalidNestedStructure {
reason: String,
line: usize,
column: usize,
},
DuplicateFieldId {
field_id: u16,
line: usize,
column: usize,
},
UnclosedNestedStructure {
structure_type: String,
opened_at_line: usize,
opened_at_column: usize,
line: usize,
column: usize,
},
}Expand description
Error type for LNMP parsing and encoding operations
Variants§
InvalidCharacter
Invalid character encountered during lexical analysis
Fields
UnterminatedString
Unterminated string literal
Fields
UnexpectedToken
Unexpected token encountered during parsing
Fields
InvalidFieldId
Invalid field ID (not a valid u16 or out of range)
Fields
InvalidValue
Invalid value for a field
Fields
InvalidChecksum
Invalid checksum (wrong format or characters)
Fields
UnexpectedEof
Unexpected end of file
Fields
InvalidEscapeSequence
Invalid escape sequence in a string
Fields
StrictModeViolation
Strict mode violation
Fields
TypeHintMismatch
Type hint mismatch
Fields
InvalidTypeHint
Invalid type hint
Fields
ChecksumMismatch
Checksum mismatch (v0.3)
Fields
NestingTooDeep
Nesting depth exceeds maximum allowed (v0.3)
Fields
InvalidNestedStructure
Invalid nested structure (v0.3)
Fields
DuplicateFieldId
Duplicate field ID in strict mode
Fields
UnclosedNestedStructure
Unclosed nested structure (v0.3)
Implementations§
Source§impl LnmpError
impl LnmpError
Sourcepub fn with_context(self, _context: ErrorContext) -> Self
pub fn with_context(self, _context: ErrorContext) -> Self
Adds error context with source snippet
Sourcepub fn format_with_source(&self, source: &str) -> String
pub fn format_with_source(&self, source: &str) -> String
Formats the error with source context for rich error messages
Trait Implementations§
Source§impl Error for LnmpError
impl Error for LnmpError
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 From<LnmpError> for BinaryError
impl From<LnmpError> for BinaryError
impl StructuralPartialEq for LnmpError
Auto Trait Implementations§
impl Freeze for LnmpError
impl RefUnwindSafe for LnmpError
impl Send for LnmpError
impl Sync for LnmpError
impl Unpin for LnmpError
impl UnwindSafe for LnmpError
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