pub struct Located<I> { /* private fields */ }
Expand description
Allow collecting the span of a parsed token
See Parser::span
and Parser::with_span
for more details
Implementations§
Trait Implementations§
source§impl<I, U> Compare<U> for Located<I>where
I: Compare<U>,
impl<I, U> Compare<U> for Located<I>where I: Compare<U>,
source§fn compare(&self, other: U) -> CompareResult
fn compare(&self, other: U) -> CompareResult
Compares self to another value for equality
source§fn compare_no_case(&self, other: U) -> CompareResult
fn compare_no_case(&self, other: U) -> CompareResult
Compares self to another value for equality
independently of the case. Read more
source§impl<I> ExtendInto for Located<I>where
I: ExtendInto,
impl<I> ExtendInto for Located<I>where I: ExtendInto,
§type Item = <I as ExtendInto>::Item
type Item = <I as ExtendInto>::Item
The current input type is a sequence of that
Item
type. Read more§type Extender = <I as ExtendInto>::Extender
type Extender = <I as ExtendInto>::Extender
The type that will be produced
source§fn new_builder(&self) -> Self::Extender
fn new_builder(&self) -> Self::Extender
Create a new
Extend
of the correct typesource§fn extend_into(&self, extender: &mut Self::Extender)
fn extend_into(&self, extender: &mut Self::Extender)
Accumulate the input into an accumulator
source§impl<I, T> FindSubstring<T> for Located<I>where
I: FindSubstring<T>,
impl<I, T> FindSubstring<T> for Located<I>where I: FindSubstring<T>,
source§fn find_substring(&self, substr: T) -> Option<usize>
fn find_substring(&self, substr: T) -> Option<usize>
Returns the byte position of the substring if it is found
source§impl<I> HexDisplay for Located<I>where
I: HexDisplay,
impl<I> HexDisplay for Located<I>where I: HexDisplay,
source§impl<I> InputIsStreaming<false> for Located<I>where
I: InputIsStreaming<false>,
impl<I> InputIsStreaming<false> for Located<I>where I: InputIsStreaming<false>,
source§fn into_complete(self) -> Self::Complete
fn into_complete(self) -> Self::Complete
Convert to complete counterpart
source§fn into_streaming(self) -> Self::Streaming
fn into_streaming(self) -> Self::Streaming
Convert to streaming counterpart
source§impl<I> InputIsStreaming<true> for Located<I>where
I: InputIsStreaming<true>,
impl<I> InputIsStreaming<true> for Located<I>where I: InputIsStreaming<true>,
source§fn into_complete(self) -> Self::Complete
fn into_complete(self) -> Self::Complete
Convert to complete counterpart
source§fn into_streaming(self) -> Self::Streaming
fn into_streaming(self) -> Self::Streaming
Convert to streaming counterpart
source§impl<I> InputIter for Located<I>where
I: InputIter,
impl<I> InputIter for Located<I>where I: InputIter,
§type Item = <I as InputIter>::Item
type Item = <I as InputIter>::Item
The current input type is a sequence of that
Item
type. Read more§type Iter = <I as InputIter>::Iter
type Iter = <I as InputIter>::Iter
An iterator over the input type, producing the item and its position
for use with Slice. If we’re iterating over
&str
, the position
corresponds to the byte index of the charactersource§fn iter_indices(&self) -> Self::Iter
fn iter_indices(&self) -> Self::Iter
Returns an iterator over the elements and their byte offsets
source§fn iter_elements(&self) -> Self::IterElem
fn iter_elements(&self) -> Self::IterElem
Returns an iterator over the elements
source§impl<I> InputLength for Located<I>where
I: InputLength,
impl<I> InputLength for Located<I>where I: InputLength,
source§impl<I> InputTake for Located<I>where
I: InputTake + Clone,
impl<I> InputTake for Located<I>where I: InputTake + Clone,
source§fn take_split(&self, count: usize) -> (Self, Self)
fn take_split(&self, count: usize) -> (Self, Self)
Split the stream at the
count
byte offset. panics if count > lengthsource§impl<I> InputTakeAtPosition for Located<I>where
I: InputTakeAtPosition + Clone,
impl<I> InputTakeAtPosition for Located<I>where I: InputTakeAtPosition + Clone,
§type Item = <I as InputTakeAtPosition>::Item
type Item = <I as InputTakeAtPosition>::Item
The current input type is a sequence of that
Item
type. Read moresource§fn split_at_position_complete<P, E>(
&self,
predicate: P
) -> IResult<Self, Self, E>where
P: Fn(Self::Item) -> bool,
E: ParseError<Self>,
fn split_at_position_complete<P, E>( &self, predicate: P ) -> IResult<Self, Self, E>where P: Fn(Self::Item) -> bool, E: ParseError<Self>,
Looks for the first element of the input type for which the condition returns true,
and returns the input up to this position. Read more
source§fn split_at_position_streaming<P, E>(
&self,
predicate: P
) -> IResult<Self, Self, E>where
P: Fn(Self::Item) -> bool,
E: ParseError<Self>,
fn split_at_position_streaming<P, E>( &self, predicate: P ) -> IResult<Self, Self, E>where P: Fn(Self::Item) -> bool, E: ParseError<Self>,
Looks for the first element of the input type for which the condition returns true,
and returns the input up to this position. Read more
source§fn split_at_position1_streaming<P, E>(
&self,
predicate: P,
kind: ErrorKind
) -> IResult<Self, Self, E>where
P: Fn(Self::Item) -> bool,
E: ParseError<Self>,
fn split_at_position1_streaming<P, E>( &self, predicate: P, kind: ErrorKind ) -> IResult<Self, Self, E>where P: Fn(Self::Item) -> bool, E: ParseError<Self>,
Looks for the first element of the input type for which the condition returns true
and returns the input up to this position. Read more
source§fn split_at_position1_complete<P, E>(
&self,
predicate: P,
kind: ErrorKind
) -> IResult<Self, Self, E>where
P: Fn(Self::Item) -> bool,
E: ParseError<Self>,
fn split_at_position1_complete<P, E>( &self, predicate: P, kind: ErrorKind ) -> IResult<Self, Self, E>where P: Fn(Self::Item) -> bool, E: ParseError<Self>,
Looks for the first element of the input type for which the condition returns true
and returns the input up to this position. Read more
source§impl<I> IntoOutput for Located<I>where
I: IntoOutput,
impl<I> IntoOutput for Located<I>where I: IntoOutput,
§type Output = <I as IntoOutput>::Output
type Output = <I as IntoOutput>::Output
Output type
source§fn into_output(self) -> Self::Output
fn into_output(self) -> Self::Output
Convert an
Input
into an appropriate Output
typesource§fn merge_output(self, inner: Self::Output) -> Self
fn merge_output(self, inner: Self::Output) -> Self
Convert an
Output
type to be used as Input
source§impl<I: Ord> Ord for Located<I>
impl<I: Ord> Ord for Located<I>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<I: PartialEq> PartialEq<Located<I>> for Located<I>
impl<I: PartialEq> PartialEq<Located<I>> for Located<I>
source§impl<I: PartialOrd> PartialOrd<Located<I>> for Located<I>
impl<I: PartialOrd> PartialOrd<Located<I>> for Located<I>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<I: Copy> Copy for Located<I>
impl<I: Eq> Eq for Located<I>
impl<I> StructuralEq for Located<I>
impl<I> StructuralPartialEq for Located<I>
Auto Trait Implementations§
impl<I> RefUnwindSafe for Located<I>where I: RefUnwindSafe,
impl<I> Send for Located<I>where I: Send,
impl<I> Sync for Located<I>where I: Sync,
impl<I> Unpin for Located<I>where I: Unpin,
impl<I> UnwindSafe for Located<I>where I: UnwindSafe,
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