Enum version_number::parsers::original::ErrorReason
source · pub enum ErrorReason {
ExpectedEndOfInput {
extra_input: Vec<u8>,
},
ExpectedSeparator {
got: Option<u8>,
},
ExpectedNumericToken {
got: Option<u8>,
},
NumberError(NumberError),
}
Expand description
Reasons for why a given input cannot be parsed to a Version
.
Variants§
ExpectedEndOfInput
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 extra_input
field contains the remaining
tokens.
The error display implementation tries to print these remaining tokens
as a String
.
Fields
ExpectedSeparator
When this error variant is returned, the ‘.’ token was expected, but a different token was present, or the end-of-input reached.
The got
field shows the token read.
ExpectedNumericToken
When this error variant is returned, a numeric token was expected, but a different token was present, or the end-of-input reached.
NumberError(NumberError)
An error variant for faults when parsing and constructing a number.
Trait Implementations§
source§impl Clone for ErrorReason
impl Clone for ErrorReason
source§fn clone(&self) -> ErrorReason
fn clone(&self) -> ErrorReason
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 ErrorReason
impl Debug for ErrorReason
source§impl Display for ErrorReason
impl Display for ErrorReason
source§impl Error for ErrorReason
impl Error for ErrorReason
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<NumberError> for ErrorReason
impl From<NumberError> for ErrorReason
source§fn from(source: NumberError) -> Self
fn from(source: NumberError) -> Self
Converts to this type from the input type.
source§impl PartialEq for ErrorReason
impl PartialEq for ErrorReason
source§fn eq(&self, other: &ErrorReason) -> bool
fn eq(&self, other: &ErrorReason) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ErrorReason
impl StructuralPartialEq for ErrorReason
Auto Trait Implementations§
impl Freeze for ErrorReason
impl RefUnwindSafe for ErrorReason
impl Send for ErrorReason
impl Sync for ErrorReason
impl Unpin for ErrorReason
impl UnwindSafe for ErrorReason
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