Skip to main content

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl TokenCount for usize

Implementors§