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,
Source§type Item = <I as ExtendInto>::Item
type Item = <I as ExtendInto>::Item
The current input type is a sequence of that
Item
type. Read moreSource§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§type Streaming = Located<<I as InputIsStreaming<false>>::Streaming>
type Streaming = Located<<I as InputIsStreaming<false>>::Streaming>
Streaming counterpart Read more
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§type Complete = Located<<I as InputIsStreaming<true>>::Complete>
type Complete = Located<<I as InputIsStreaming<true>>::Complete>
Complete counterpart Read more
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,
Source§type Item = <I as InputIter>::Item
type Item = <I as InputIter>::Item
The current input type is a sequence of that
Item
type. Read moreSource§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§type IterElem = <I as InputIter>::IterElem
type IterElem = <I as InputIter>::IterElem
An iterator over the input type, producing the item
Source§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> InputTakeAtPosition for Located<I>where
I: InputTakeAtPosition + Clone,
impl<I> InputTakeAtPosition for Located<I>where
I: InputTakeAtPosition + Clone,
Source§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>
fn split_at_position_complete<P, E>( &self, predicate: P, ) -> IResult<Self, Self, E>
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>
fn split_at_position_streaming<P, E>( &self, predicate: P, ) -> IResult<Self, Self, E>
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>
fn split_at_position1_streaming<P, E>( &self, predicate: P, kind: ErrorKind, ) -> IResult<Self, Self, E>
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,
Source§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: PartialOrd> PartialOrd for Located<I>
impl<I: PartialOrd> PartialOrd for Located<I>
impl<I: Copy> Copy for Located<I>
impl<I: Eq> Eq for Located<I>
impl<I> StructuralPartialEq for Located<I>
Auto Trait Implementations§
impl<I> Freeze for Located<I>where
I: Freeze,
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