pub struct TokenWithLocation {
pub token: Token,
pub location: Location,
}
Fields§
§token: Token
§location: Location
Implementations§
source§impl TokenWithLocation
impl TokenWithLocation
pub fn new(token: Token, line: u64, column: u64) -> TokenWithLocation
pub fn eof() -> TokenWithLocation
Trait Implementations§
source§impl Clone for TokenWithLocation
impl Clone for TokenWithLocation
source§fn clone(&self) -> TokenWithLocation
fn clone(&self) -> TokenWithLocation
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 TokenWithLocation
impl Debug for TokenWithLocation
source§impl Display for TokenWithLocation
impl Display for TokenWithLocation
source§impl<I> Parser<I, TokenWithLocation, ContextError> for Tokenwhere
I: TokenStream,
impl<I> Parser<I, TokenWithLocation, ContextError> for Tokenwhere
I: TokenStream,
source§fn parse_next(
&mut self,
input: &mut I,
) -> PResult<TokenWithLocation, ContextError>
fn parse_next( &mut self, input: &mut I, ) -> PResult<TokenWithLocation, ContextError>
Take tokens from the [
Stream
], turning it into the output Read more§fn parse_peek(&mut self, input: I) -> Result<(I, O), ErrMode<E>>
fn parse_peek(&mut self, input: I) -> Result<(I, O), ErrMode<E>>
Take tokens from the [
Stream
], turning it into the output Read more§fn default_value<O2>(self) -> DefaultValue<Self, I, O, O2, E>
fn default_value<O2>(self) -> DefaultValue<Self, I, O, O2, E>
Produce a type’s default value Read more
§fn output_into<O2>(self) -> OutputInto<Self, I, O, O2, E>
fn output_into<O2>(self) -> OutputInto<Self, I, O, O2, E>
Convert the parser’s output to another type using
std::convert::From
Read more§fn recognize(self) -> Recognize<Self, I, O, E>where
Self: Sized,
I: Stream,
fn recognize(self) -> Recognize<Self, I, O, E>where
Self: Sized,
I: Stream,
Produce the consumed input as produced value. Read more
§fn with_recognized(self) -> WithRecognized<Self, I, O, E>where
Self: Sized,
I: Stream,
fn with_recognized(self) -> WithRecognized<Self, I, O, E>where
Self: Sized,
I: Stream,
Produce the consumed input with the output Read more
§fn map<G, O2>(self, map: G) -> Map<Self, G, I, O, O2, E>
fn map<G, O2>(self, map: G) -> Map<Self, G, I, O, O2, E>
Maps a function over the output of a parser Read more
§fn try_map<G, O2, E2>(self, map: G) -> TryMap<Self, G, I, O, O2, E, E2>
fn try_map<G, O2, E2>(self, map: G) -> TryMap<Self, G, I, O, O2, E, E2>
Applies a function returning a
Result
over the output of a parser. Read more§fn verify_map<G, O2>(self, map: G) -> VerifyMap<Self, G, I, O, O2, E>
fn verify_map<G, O2>(self, map: G) -> VerifyMap<Self, G, I, O, O2, E>
§fn flat_map<G, H, O2>(self, map: G) -> FlatMap<Self, G, H, I, O, O2, E>
fn flat_map<G, H, O2>(self, map: G) -> FlatMap<Self, G, H, I, O, O2, E>
Creates a parser from the output of this one Read more
§fn parse_to<O2>(self) -> ParseTo<Self, I, O, O2, E>where
Self: Sized,
I: Stream,
O: ParseSlice<O2>,
E: ParserError<I>,
fn parse_to<O2>(self) -> ParseTo<Self, I, O, O2, E>where
Self: Sized,
I: Stream,
O: ParseSlice<O2>,
E: ParserError<I>,
Apply
std::str::FromStr
to the output of the parser Read more§fn verify<G, O2>(self, filter: G) -> Verify<Self, G, I, O, O2, E>
fn verify<G, O2>(self, filter: G) -> Verify<Self, G, I, O, O2, E>
Returns the output of the child parser if it satisfies a verification function. Read more
§fn context<C>(self, context: C) -> Context<Self, I, O, E, C>
fn context<C>(self, context: C) -> Context<Self, I, O, E, C>
If parsing fails, add context to the error Read more
§fn complete_err(self) -> CompleteErr<Self>where
Self: Sized,
fn complete_err(self) -> CompleteErr<Self>where
Self: Sized,
Transforms [
Incomplete
][crate::error::ErrMode::Incomplete] into [Backtrack
][crate::error::ErrMode::Backtrack] Read more§fn err_into<E2>(self) -> ErrInto<Self, I, O, E, E2>
fn err_into<E2>(self) -> ErrInto<Self, I, O, E, E2>
Convert the parser’s error to another type using
std::convert::From
source§impl PartialEq<Token> for TokenWithLocation
impl PartialEq<Token> for TokenWithLocation
source§impl PartialEq<TokenWithLocation> for Token
impl PartialEq<TokenWithLocation> for Token
source§impl PartialEq for TokenWithLocation
impl PartialEq for TokenWithLocation
impl Eq for TokenWithLocation
impl StructuralPartialEq for TokenWithLocation
Auto Trait Implementations§
impl Freeze for TokenWithLocation
impl RefUnwindSafe for TokenWithLocation
impl Send for TokenWithLocation
impl Sync for TokenWithLocation
impl Unpin for TokenWithLocation
impl UnwindSafe for TokenWithLocation
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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