#[repr(C)]pub struct ParserLimits {
pub max_items_in_row: usize,
pub initial_lexer_fuel: u64,
pub step_lexer_fuel: u64,
pub step_max_items: usize,
pub max_lexer_states: usize,
pub max_grammar_size: usize,
pub precompute_large_lexemes: bool,
pub verbose_errors: bool,
}Fields§
§max_items_in_row: usizeFor non-ambiguous grammars, this is the maximum “branching factor” of the grammar. For ambiguous grammars, this might get hit much quicker. Default: 2000
initial_lexer_fuel: u64How much “fuel” are we willing to spend to build initial lexer regex AST nodes. Default: 1_000_000 Speed: 50k/ms
step_lexer_fuel: u64Maximum lexer fuel for computation of the whole token mask. Default: 200_000 Speed: 14k/ms
step_max_items: usizeNumber of Earley items created for the whole token mask. Default: 50_000 Speed: 20k/ms
max_lexer_states: usizeMaximum number of lexer states. Affects memory consumption, but not the speed for the most part. Default: 250_000 Speed: ~1-2kB of memory per state
max_grammar_size: usizeMaximum size of the grammar (symbols in productions) Default: 500_000 (a few megabytes of JSON)
precompute_large_lexemes: boolIf true, we’ll run any extremely large regexes against the whole trie of the tokenizer while constructing the lexer. This reduces future mask computation time, but increases the time it takes to construct the lexer. Default: true
verbose_errors: boolIf true, include parser state (including tokens so far) and grammar in errors. Default: true
Trait Implementations§
Source§impl Clone for ParserLimits
impl Clone for ParserLimits
Source§fn clone(&self) -> ParserLimits
fn clone(&self) -> ParserLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParserLimits
impl Debug for ParserLimits
Source§impl Default for ParserLimits
impl Default for ParserLimits
Source§impl<'de> Deserialize<'de> for ParserLimitswhere
ParserLimits: Default,
impl<'de> Deserialize<'de> for ParserLimitswhere
ParserLimits: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ParserLimits
impl RefUnwindSafe for ParserLimits
impl Send for ParserLimits
impl Sync for ParserLimits
impl Unpin for ParserLimits
impl UnsafeUnpin for ParserLimits
impl UnwindSafe for ParserLimits
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more