Enum version_number::parsers::error::ExpectedError
source · pub enum ExpectedError {
Separator {
at: Option<usize>,
got: Option<char>,
},
EndOfInput {
at: Option<usize>,
got: char,
},
Numeric {
at: Option<usize>,
got: Option<char>,
},
}
Expand description
An error type for faults relating to parsing and expecting a certain type of token.
Variants§
Separator
When this error variant is returned, the .
token, i.e. the separator, was expected, but
a different token was present. The got
field shows the token read.
Fields
EndOfInput
When this error variant is returned, the parser expected that no more tokens should be present, but instead 1 or more additional tokens were not parsed yet.
The got
field contains the next token received, where
it expected none to be remaining.
Fields
Numeric
When this error variant is returned, a numeric token was expected, but a different token was present.
The got
field shows the token read.
Trait Implementations§
source§impl Clone for ExpectedError
impl Clone for ExpectedError
source§fn clone(&self) -> ExpectedError
fn clone(&self) -> ExpectedError
Returns a copy 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 ExpectedError
impl Debug for ExpectedError
source§impl Display for ExpectedError
impl Display for ExpectedError
source§impl Error for ExpectedError
impl Error for ExpectedError
1.30.0 · 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<ExpectedError> for ParserError
impl From<ExpectedError> for ParserError
source§fn from(source: ExpectedError) -> Self
fn from(source: ExpectedError) -> Self
Converts to this type from the input type.
source§impl PartialEq for ExpectedError
impl PartialEq for ExpectedError
source§fn eq(&self, other: &ExpectedError) -> bool
fn eq(&self, other: &ExpectedError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ExpectedError
impl StructuralPartialEq for ExpectedError
Auto Trait Implementations§
impl Freeze for ExpectedError
impl RefUnwindSafe for ExpectedError
impl Send for ExpectedError
impl Sync for ExpectedError
impl Unpin for ExpectedError
impl UnwindSafe for ExpectedError
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