[−][src]Enum manger::ConsumeErrorType
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
An error varient which occurs when while consuming more tokens where expected, but none were found.
Fields of InsufficientTokens
index: usize
The utf-8 character index within the source
at which more tokens were expected, but not
found.
An error varient which occurs when while consuming a token that was not expected is presented.
Fields of UnexpectedToken
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.
Fields of InvalidValue
index: usize
The utf-8 character index within the source
at which an invalid value started to be
formed.
Implementations
impl ConsumeErrorType
[src]
pub fn index(&self) -> &usize
[src]
Fetch the utf-8 character index at which a consume error occured.
pub fn offset(self, by: usize) -> Self
[src]
Mutate self to move the utf-8 character index at which they were caused by by
.
Examples
use manger::ConsumeErrorType::*; assert_eq!( InvalidValue { index: 0 }.offset(2), InvalidValue { index: 2 }, );
Trait Implementations
impl Clone for ConsumeErrorType
[src]
pub fn clone(&self) -> ConsumeErrorType
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for ConsumeErrorType
[src]
impl Debug for ConsumeErrorType
[src]
impl Display for ConsumeErrorType
[src]
impl Error for ConsumeErrorType
[src]
pub fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
pub fn backtrace(&self) -> Option<&Backtrace>
[src]
pub fn description(&self) -> &str
1.0.0[src]
pub fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl PartialEq<ConsumeErrorType> for ConsumeErrorType
[src]
pub fn eq(&self, other: &ConsumeErrorType) -> bool
[src]
pub fn ne(&self, other: &ConsumeErrorType) -> bool
[src]
impl StructuralPartialEq for ConsumeErrorType
[src]
Auto Trait Implementations
impl RefUnwindSafe for ConsumeErrorType
[src]
impl Send for ConsumeErrorType
[src]
impl Sync for ConsumeErrorType
[src]
impl Unpin for ConsumeErrorType
[src]
impl UnwindSafe for ConsumeErrorType
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,