Struct kodept_parse::token_stream::TokenStream
source · pub struct TokenStream<'t> { /* private fields */ }
Implementations§
source§impl<'t> TokenStream<'t>
impl<'t> TokenStream<'t>
pub fn iter(&self) -> TokenStreamIterator<'_> ⓘ
pub const fn new(slice: &'t [TokenMatch<'t>]) -> Self
pub fn into_token_match(self) -> Option<TokenMatch<'t>>
pub fn as_token_vec(&self) -> Vec<&Token<'_>>
Trait Implementations§
source§impl<'t> Clone for TokenStream<'t>
impl<'t> Clone for TokenStream<'t>
source§fn clone(&self) -> TokenStream<'t>
fn clone(&self) -> TokenStream<'t>
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<'t> Debug for TokenStream<'t>
impl<'t> Debug for TokenStream<'t>
source§impl Display for TokenStream<'_>
impl Display for TokenStream<'_>
source§impl<'t> InputIter for TokenStream<'t>
impl<'t> InputIter for TokenStream<'t>
§type Item = TokenMatch<'t>
type Item = TokenMatch<'t>
The current input type is a sequence of that
Item
type. Read more§type Iter = TokenStreamIndices<'t>
type Iter = TokenStreamIndices<'t>
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 character§type IterElem = TokenStreamIterator<'t>
type IterElem = TokenStreamIterator<'t>
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<'t> InputLength for TokenStream<'t>
impl<'t> InputLength for TokenStream<'t>
source§impl<'t> InputTake for TokenStream<'t>
impl<'t> InputTake for TokenStream<'t>
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> RecreateContext<TokenStream<'t>> for CodePoint
impl<'t> RecreateContext<TokenStream<'t>> for CodePoint
source§fn recreate_context(
original_input: TokenStream<'t>,
tail: TokenStream<'t>
) -> Self
fn recreate_context( original_input: TokenStream<'t>, tail: TokenStream<'t> ) -> Self
Given the original input, as well as the context reported by nom,
recreate a context in the original string where the error occurred. Read more
impl<'t> UnspecializedInput for TokenStream<'t>
Auto Trait Implementations§
impl<'t> Freeze for TokenStream<'t>
impl<'t> RefUnwindSafe for TokenStream<'t>
impl<'t> Send for TokenStream<'t>
impl<'t> Sync for TokenStream<'t>
impl<'t> Unpin for TokenStream<'t>
impl<'t> UnwindSafe for TokenStream<'t>
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, U> ConvertibleToMut<U> for T
impl<T, U> ConvertibleToMut<U> for T
fn try_as_mut(&mut self) -> Option<&mut U>
source§impl<T, U> ConvertibleToRef<U> for T
impl<T, U> ConvertibleToRef<U> for T
fn try_as_ref(&self) -> Option<&U>
source§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
source§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original
input to the nom parser, extract more the useful context information. Read more
source§impl<T> Indentable for Twhere
T: Display,
impl<T> Indentable for Twhere
T: Display,
source§fn indented_skip_initial(self, indent: &str) -> IndentedSkipIntial<'_, Self>
fn indented_skip_initial(self, indent: &str) -> IndentedSkipIntial<'_, Self>
source§impl<T> InputTakeAtPosition for T
impl<T> InputTakeAtPosition for T
§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>(&self, predicate: P) -> Result<(T, T), Err<E>>
fn split_at_position<P, E>(&self, predicate: P) -> Result<(T, T), Err<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<P, E>(
&self,
predicate: P,
e: ErrorKind
) -> Result<(T, T), Err<E>>
fn split_at_position1<P, E>( &self, predicate: P, e: ErrorKind ) -> Result<(T, T), Err<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_complete<P, E>(
&self,
predicate: P
) -> Result<(T, T), Err<E>>
fn split_at_position_complete<P, E>( &self, predicate: P ) -> Result<(T, T), Err<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<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
source§fn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom,
recreate a context in the original string where the error occurred. Read more