Struct ParserLimits
#[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§
§impl Clone for ParserLimits
impl Clone for ParserLimits
§fn clone(&self) -> ParserLimits
fn clone(&self) -> ParserLimits
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ParserLimits
impl Debug for ParserLimits
§impl Default for ParserLimits
impl Default for ParserLimits
§fn default() -> ParserLimits
fn default() -> ParserLimits
§impl<'de> Deserialize<'de> for ParserLimitswhere
ParserLimits: Default,
impl<'de> Deserialize<'de> for ParserLimitswhere
ParserLimits: Default,
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ParserLimits, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ParserLimits, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Serialize for ParserLimits
impl Serialize for ParserLimits
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for ParserLimits
impl RefUnwindSafe for ParserLimits
impl Send for ParserLimits
impl Sync for ParserLimits
impl Unpin 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> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Any.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Any.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.