pub enum ConsumeErrorType {
InsufficientTokens {
index: usize,
},
UnexpectedToken {
index: usize,
token: char,
},
InvalidValue {
index: usize,
},
}
Expand description
One item in ConsumeError
. these can occur while consuming
from a `source.
Multiple instances of this type can occur during one parsing.
Especially, multiple instance of these error occur,
when using enum
’s or using the Either<L, R>
struct.
Variants§
InsufficientTokens
An error varient which occurs when while consuming more tokens where expected, but none were found.
Fields
UnexpectedToken
An error varient which occurs when while consuming a token that was not expected is presented.
Fields
InvalidValue
An error varient which occurs when while consuming a consume condition is not met.
This happens most often when a condition is specified for consumation, but it is not met. However, this also happens when a integer or float overflows tries to assume an incorrect value.
Implementations§
Trait Implementations§
Source§impl Clone for ConsumeErrorType
impl Clone for ConsumeErrorType
Source§fn clone(&self) -> ConsumeErrorType
fn clone(&self) -> ConsumeErrorType
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 ConsumeErrorType
impl Debug for ConsumeErrorType
Source§impl Display for ConsumeErrorType
impl Display for ConsumeErrorType
Source§impl Error for ConsumeErrorType
impl Error for ConsumeErrorType
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()
Source§impl PartialEq for ConsumeErrorType
impl PartialEq for ConsumeErrorType
impl Copy for ConsumeErrorType
impl StructuralPartialEq for ConsumeErrorType
Auto Trait Implementations§
impl Freeze for ConsumeErrorType
impl RefUnwindSafe for ConsumeErrorType
impl Send for ConsumeErrorType
impl Sync for ConsumeErrorType
impl Unpin for ConsumeErrorType
impl UnwindSafe for ConsumeErrorType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more