pub trait Tracker {
type Error;
// Required methods
fn increase_token(&mut self);
fn increase_recursion(&mut self);
fn decrease_recursion(&mut self);
fn check(&self) -> Result<(), Self::Error>;
// Provided methods
fn increase_token_and_decrease_recursion(&mut self) { ... }
fn increase_token_and_decrease_recursion_and_check(
&mut self,
) -> Result<(), Self::Error> { ... }
fn increase_token_and_check(&mut self) -> Result<(), Self::Error> { ... }
fn increase_both(&mut self) { ... }
fn increase_both_and_check(&mut self) -> Result<(), Self::Error> { ... }
}Expand description
A tracker that combines both token and recursion tracking.
Required Associated Types§
Required Methods§
Sourcefn increase_token(&mut self)
fn increase_token(&mut self)
Increases the token count.
Sourcefn increase_recursion(&mut self)
fn increase_recursion(&mut self)
Increases the recursion depth.
Sourcefn decrease_recursion(&mut self)
fn decrease_recursion(&mut self)
Decreases the recursion depth.
Provided Methods§
Sourcefn increase_token_and_decrease_recursion(&mut self)
fn increase_token_and_decrease_recursion(&mut self)
Increase the token count and decrease recursion depth.
Sourcefn increase_token_and_decrease_recursion_and_check(
&mut self,
) -> Result<(), Self::Error>
fn increase_token_and_decrease_recursion_and_check( &mut self, ) -> Result<(), Self::Error>
Increases the token count and decreases recursion depth and checks limits.
Sourcefn increase_token_and_check(&mut self) -> Result<(), Self::Error>
fn increase_token_and_check(&mut self) -> Result<(), Self::Error>
Increases the token count and checks limits.
Sourcefn increase_both(&mut self)
fn increase_both(&mut self)
Increases the token count and recursion depth, then checks limits.
Sourcefn increase_both_and_check(&mut self) -> Result<(), Self::Error>
fn increase_both_and_check(&mut self) -> Result<(), Self::Error>
Increase the token count, decrease recursion depth, then checks limits.
Implementations on Foreign Types§
Source§impl<'a, T> Tracker for Lexer<'a, T>
Available on crate feature logos only.
impl<'a, T> Tracker for Lexer<'a, T>
Available on crate feature
logos only.