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
sourceimpl<I, U> Compare<U> for Located<I>where
I: Compare<U>,
impl<I, U> Compare<U> for Located<I>where
I: Compare<U>,
sourcefn compare(&self, other: U) -> CompareResult
fn compare(&self, other: U) -> CompareResult
Compares self to another value for equality
sourcefn 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
sourceimpl<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 moretype Extender = <I as ExtendInto>::Extender
type Extender = <I as ExtendInto>::Extender
The type that will be produced
sourcefn new_builder(&self) -> Self::Extender
fn new_builder(&self) -> Self::Extender
Create a new
Extend
of the correct typesourcefn extend_into(&self, extender: &mut Self::Extender)
fn extend_into(&self, extender: &mut Self::Extender)
Accumulate the input into an accumulator
sourceimpl<I, T> FindSubstring<T> for Located<I>where
I: FindSubstring<T>,
impl<I, T> FindSubstring<T> for Located<I>where
I: FindSubstring<T>,
sourcefn 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
sourceimpl<I> HexDisplay for Located<I>where
I: HexDisplay,
impl<I> HexDisplay for Located<I>where
I: HexDisplay,
sourceimpl<I> InputIsStreaming<false> for Located<I>where
I: InputIsStreaming<false>,
impl<I> InputIsStreaming<false> for Located<I>where
I: InputIsStreaming<false>,
type Streaming = Located<<I as InputIsStreaming<false>>::Streaming>
type Streaming = Located<<I as InputIsStreaming<false>>::Streaming>
Streaming counterpart Read more
sourcefn into_complete(self) -> Self::Complete
fn into_complete(self) -> Self::Complete
Convert to complete counterpart
sourcefn into_streaming(self) -> Self::Streaming
fn into_streaming(self) -> Self::Streaming
Convert to streaming counterpart
sourceimpl<I> InputIsStreaming<true> for Located<I>where
I: InputIsStreaming<true>,
impl<I> InputIsStreaming<true> for Located<I>where
I: InputIsStreaming<true>,
type Complete = Located<<I as InputIsStreaming<true>>::Complete>
type Complete = Located<<I as InputIsStreaming<true>>::Complete>
Complete counterpart Read more
sourcefn into_complete(self) -> Self::Complete
fn into_complete(self) -> Self::Complete
Convert to complete counterpart
sourcefn into_streaming(self) -> Self::Streaming
fn into_streaming(self) -> Self::Streaming
Convert to streaming counterpart
sourceimpl<I> InputIter for Located<I>where
I: InputIter,
impl<I> InputIter for Located<I>where
I: InputIter,
sourcefn iter_indices(&self) -> Self::Iter
fn iter_indices(&self) -> Self::Iter
Returns an iterator over the elements and their byte offsets
sourcefn iter_elements(&self) -> Self::IterElem
fn iter_elements(&self) -> Self::IterElem
Returns an iterator over the elements
sourceimpl<I> InputLength for Located<I>where
I: InputLength,
impl<I> InputLength for Located<I>where
I: InputLength,
sourceimpl<I> InputTake for Located<I>where
I: InputTake + Clone,
impl<I> InputTake for Located<I>where
I: InputTake + Clone,
sourcefn 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 > lengthsourceimpl<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 moresourcefn 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
sourcefn 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
sourcefn 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
sourcefn 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
sourceimpl<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
sourcefn into_output(self) -> Self::Output
fn into_output(self) -> Self::Output
Convert an
Input
into an appropriate Output
typesourcefn merge_output(self, inner: Self::Output) -> Self
fn merge_output(self, inner: Self::Output) -> Self
Convert an
Output
type to be used as Input
sourceimpl<I: Ord> Ord for Located<I>
impl<I: Ord> Ord for Located<I>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<I: PartialEq> PartialEq<Located<I>> for Located<I>
impl<I: PartialEq> PartialEq<Located<I>> for Located<I>
sourceimpl<I: PartialOrd> PartialOrd<Located<I>> for Located<I>
impl<I: PartialOrd> PartialOrd<Located<I>> for Located<I>
sourcefn partial_cmp(&self, other: &Located<I>) -> Option<Ordering>
fn partial_cmp(&self, other: &Located<I>) -> Option<Ordering>
1.0.0 · sourcefn 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more