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 token_iter(&self) -> impl Iterator<Item = &Token<'_>>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter_indices(&self) -> TokenStreamIndices<'_> ⓘ
pub fn iter_elements(&self) -> TokenStreamIterator<'_> ⓘ
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> Original<Token<'t>> for TokenStream<'t>
impl<'t> Original<Token<'t>> for TokenStream<'t>
source§impl<'t> Parse for TokenStream<'t>
impl<'t> Parse for TokenStream<'t>
source§impl<'input> ParseElem<'input> for TokenStream<'input>
impl<'input> ParseElem<'input> for TokenStream<'input>
§type Element = TokenMatch<'input>
type Element = TokenMatch<'input>
Type of a single atomic element of the input, for example a character or token
source§fn parse_elem(&'input self, pos: usize) -> RuleResult<Self::Element>
fn parse_elem(&'input self, pos: usize) -> RuleResult<Self::Element>
Get the element at
pos, or Failed if past end of input.source§impl<'input> ParseLiteral for TokenStream<'input>
impl<'input> ParseLiteral for TokenStream<'input>
source§fn parse_string_literal(&self, pos: usize, literal: &str) -> RuleResult<()>
fn parse_string_literal(&self, pos: usize, literal: &str) -> RuleResult<()>
Attempt to match the
literal string at pos, returning whether it
matched or failed.source§impl<'input> ParseSlice<'input> for TokenStream<'input>
impl<'input> ParseSlice<'input> for TokenStream<'input>
§type Slice = TokenStream<'input>
type Slice = TokenStream<'input>
Type of a slice of the input.
source§impl<'t> PartialEq for TokenStream<'t>
impl<'t> PartialEq for TokenStream<'t>
source§fn eq(&self, other: &TokenStream<'t>) -> bool
fn eq(&self, other: &TokenStream<'t>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl<'t> Copy for TokenStream<'t>
impl<'t> StructuralPartialEq 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> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)