pub enum Error {
UnexpectedEof,
InvalidCharacter {
ch: char,
pos: usize,
},
InvalidNumber {
text: String,
pos: usize,
},
InvalidEscape {
seq: String,
pos: usize,
},
InvalidHeader {
text: String,
pos: usize,
},
ArrayLengthMismatch {
declared: usize,
found: usize,
pos: usize,
},
FieldCountMismatch {
expected: usize,
found: usize,
pos: usize,
},
InvalidIndentation {
expected: usize,
found: usize,
pos: usize,
},
MissingColon {
pos: usize,
},
InvalidUtf8,
Message(String),
}Expand description
Errors that can occur during TOON parsing or serialization
Variants§
UnexpectedEof
Unexpected end of input
InvalidCharacter
Invalid character at position
InvalidNumber
Invalid number format
InvalidEscape
Invalid escape sequence
InvalidHeader
Invalid header syntax (array declaration)
ArrayLengthMismatch
Array length mismatch: declared N but found M elements
FieldCountMismatch
Field count mismatch in tabular row
InvalidIndentation
Invalid indentation (wrong depth)
MissingColon
Missing colon after key
InvalidUtf8
Invalid UTF-8 in input
Message(String)
Generic message
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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