pub enum ParseError {
Show 14 variants
MissingSource {
input: String,
at: usize,
},
UnexpectedEnd {
input: String,
at: usize,
expected: &'static str,
},
UnexpectedChar {
input: String,
at: usize,
found: char,
expected: &'static str,
},
InvalidIdentifier {
input: String,
at: usize,
found: String,
},
EmptyKey {
input: String,
at: usize,
},
EmptyValue {
input: String,
at: usize,
},
InvalidEscape {
input: String,
at: usize,
},
UnclosedString {
input: String,
at: usize,
},
UnclosedList {
input: String,
at: usize,
},
UnclosedMap {
input: String,
at: usize,
},
TrailingComma {
input: String,
at: usize,
},
InvalidNumber {
input: String,
at: usize,
found: String,
},
TrailingInput {
input: String,
at: usize,
rest: String,
},
SkipMarkerBeforeOptions {
input: String,
at: usize,
},
}Expand description
Error while parsing a configuration source string.
Format: SOURCE [(OPTIONS)] [?] [:RESOURCE] — see the crate README for rules.
Display is one line by default; use {error:#} for the input snippet and caret.
Variants§
MissingSource
No source identifier (empty input or invalid start).
UnexpectedEnd
Input ended before a required token.
UnexpectedChar
Unexpected character at the current position.
InvalidIdentifier
Option or map key is not a valid identifier.
EmptyKey
Option or map key is empty.
EmptyValue
Option value is empty; use "" for an empty string.
InvalidEscape
Invalid escape sequence inside a quoted string.
UnclosedString
Quoted string has no closing ".
UnclosedList
List has no closing ].
UnclosedMap
Map or options block has no closing ).
TrailingComma
Comma with no following entry.
InvalidNumber
Token looks like a number but is not valid.
TrailingInput
Non-empty input after a complete configuration source.
SkipMarkerBeforeOptions
Skip marker ? appears before (...) options (source?(...) is invalid).
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
impl Eq for ParseError
Source§impl Error for ParseError
impl Error for ParseError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Source§impl PartialEq for ParseError
impl PartialEq for ParseError
Source§fn eq(&self, other: &ParseError) -> bool
fn eq(&self, other: &ParseError) -> bool
self and other values to be equal, and is used by ==.