TokenCount

Trait TokenCount 

Source
pub trait TokenCount {
    // Required method
    fn token_count(self) -> usize;
}
Expand description

We track the position of the error by counting tokens. This trait is implemented for references to shadow counted TokenIter, and usize. The later allows to pass in a position directly or use usize::MAX in case no position data is available (which will make this error the be the final one when upgrading).

Required Methods§

Source

fn token_count(self) -> usize

Get the position of the token iterator.

Implementations on Foreign Types§

Source§

impl TokenCount for &&mut ShadowCountedIter<'_, <TokenStream as IntoIterator>::IntoIter>

Source§

impl TokenCount for &ShadowCountedIter<'_, <TokenStream as IntoIterator>::IntoIter>

Source§

impl TokenCount for &mut ShadowCountedIter<'_, <TokenStream as IntoIterator>::IntoIter>

Source§

impl TokenCount for usize

Implementors§