pub struct Spanned<T> { /* private fields */ }Expand description
You can wrap your input in this struct with Spanned::new
Implementations§
Trait Implementations§
source§impl<T> Compare<T> for Spanned<T>where
T: Compare<T>,
impl<T> Compare<T> for Spanned<T>where T: Compare<T>,
source§fn compare(&self, t: T) -> CompareResult
fn compare(&self, t: T) -> CompareResult
Compares self to another value for equality
source§fn compare_no_case(&self, t: T) -> CompareResult
fn compare_no_case(&self, t: T) -> CompareResult
Compares self to another value for equality
independently of the case. Read more
source§impl<T> ExtendInto for Spanned<T>where
T: ExtendInto,
impl<T> ExtendInto for Spanned<T>where T: ExtendInto,
§type Item = <T as ExtendInto>::Item
type Item = <T as ExtendInto>::Item
The current input type is a sequence of that
Item type. Read more§type Extender = <T as ExtendInto>::Extender
type Extender = <T 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, acc: &mut Self::Extender)
fn extend_into(&self, acc: &mut Self::Extender)
Accumulate the input into an accumulator
source§impl<T> FindSubstring<T> for Spanned<T>where
T: FindSubstring<T>,
impl<T> FindSubstring<T> for Spanned<T>where T: 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<T, Token> FindToken<Token> for Spanned<T>where
T: FindToken<Token>,
impl<T, Token> FindToken<Token> for Spanned<T>where T: FindToken<Token>,
source§fn find_token(&self, token: Token) -> bool
fn find_token(&self, token: Token) -> bool
Returns true if self contains the token
source§impl<T> InputIter for Spanned<T>where
T: InputIter,
impl<T> InputIter for Spanned<T>where T: InputIter,
§type Item = <T as InputIter>::Item
type Item = <T as InputIter>::Item
The current input type is a sequence of that
Item type. Read more§type Iter = <T as InputIter>::Iter
type Iter = <T 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<T> InputLength for Spanned<T>where
T: InputLength,
impl<T> InputLength for Spanned<T>where T: InputLength,
source§impl<T> InputTake for Spanned<T>where
Self: Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
impl<T> InputTake for Spanned<T>where Self: Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
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<T> InputTakeAtPosition for Spanned<T>where
T: InputTakeAtPosition + InputLength + InputIter,
Self: Slice<RangeFrom<usize>> + Slice<RangeTo<usize>> + Clone,
impl<T> InputTakeAtPosition for Spanned<T>where T: InputTakeAtPosition + InputLength + InputIter, Self: Slice<RangeFrom<usize>> + Slice<RangeTo<usize>> + Clone,
§type Item = <T as InputIter>::Item
type Item = <T as InputIter>::Item
The current input type is a sequence of that
Item type. Read moresource§fn split_at_position<P, E: ParseError<Self>>(
&self,
predicate: P
) -> IResult<Self, Self, E>where
P: Fn(Self::Item) -> bool,
fn split_at_position<P, E: ParseError<Self>>( &self, predicate: P ) -> IResult<Self, Self, E>where P: Fn(Self::Item) -> bool,
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<P, E: ParseError<Self>>(
&self,
predicate: P,
_e: ErrorKind
) -> IResult<Self, Self, E>where
P: Fn(Self::Item) -> bool,
fn split_at_position1<P, E: ParseError<Self>>( &self, predicate: P, _e: ErrorKind ) -> IResult<Self, Self, E>where P: Fn(Self::Item) -> bool,
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_complete<P, E: ParseError<Self>>(
&self,
predicate: P
) -> IResult<Self, Self, E>where
P: Fn(Self::Item) -> bool,
fn split_at_position_complete<P, E: ParseError<Self>>( &self, predicate: P ) -> IResult<Self, Self, E>where P: Fn(Self::Item) -> bool,
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: ParseError<Self>>(
&self,
predicate: P,
e: ErrorKind
) -> IResult<Self, Self, E>where
P: Fn(Self::Item) -> bool,
fn split_at_position1_complete<P, E: ParseError<Self>>( &self, predicate: P, e: ErrorKind ) -> IResult<Self, Self, E>where P: Fn(Self::Item) -> bool,
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<T: PartialEq> PartialEq for Spanned<T>
impl<T: PartialEq> PartialEq for Spanned<T>
source§impl<T, R> Slice<R> for Spanned<T>where
T: Slice<R> + Offset + AsBytes + Slice<RangeTo<usize>>,
impl<T, R> Slice<R> for Spanned<T>where T: Slice<R> + Offset + AsBytes + Slice<RangeTo<usize>>,
impl<T: Copy> Copy for Spanned<T>
impl<T: Eq> Eq for Spanned<T>
impl<T> StructuralEq for Spanned<T>
impl<T> StructuralPartialEq for Spanned<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Spanned<T>where T: RefUnwindSafe,
impl<T> Send for Spanned<T>where T: Send,
impl<T> Sync for Spanned<T>where T: Sync,
impl<T> Unpin for Spanned<T>where T: Unpin,
impl<T> UnwindSafe for Spanned<T>where T: 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