Enum fastobo::error::SyntaxError
source · pub enum SyntaxError {
UnexpectedRule {
expected: Rule,
actual: Rule,
},
ParserError {
error: Box<PestError<Rule>>,
},
}
Expand description
A syntax error.
Variants§
UnexpectedRule
An unexpected rule was used in FromPair::from_pair
.
Example
let cache = Cache::new();
let pairs = Lexer::tokenize(Rule::UnquotedString, "hello, world!");
let pair = pairs.unwrap().next().unwrap();
QuotedString::from_pair(pair, &cache).unwrap_err();
ParserError
The underlying parser encountered an error.
Example
QuotedString::from_str("definitely not a quoted string").unwrap_err();
Trait Implementations§
source§impl Debug for SyntaxError
impl Debug for SyntaxError
source§impl Display for SyntaxError
impl Display for SyntaxError
source§impl Error for SyntaxError
impl Error for SyntaxError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<SyntaxError> for Error
impl From<SyntaxError> for Error
source§fn from(source: SyntaxError) -> Self
fn from(source: SyntaxError) -> Self
Converts to this type from the input type.
source§impl PartialEq<SyntaxError> for SyntaxError
impl PartialEq<SyntaxError> for SyntaxError
source§fn eq(&self, other: &SyntaxError) -> bool
fn eq(&self, other: &SyntaxError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for SyntaxError
impl StructuralEq for SyntaxError
impl StructuralPartialEq for SyntaxError
Auto Trait Implementations§
impl RefUnwindSafe for SyntaxError
impl Send for SyntaxError
impl Sync for SyntaxError
impl Unpin for SyntaxError
impl UnwindSafe for SyntaxError
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