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,
}
Fields§
§max_items_in_row: usize
For non-ambiguous grammars, this is the maximum “branching factor” of the grammar. For ambiguous grammars, this might get hit much quicker. Default: 200
initial_lexer_fuel: u64
How much “fuel” are we willing to spend to build initial lexer regex AST nodes. Default: 1_000_000 (~20ms)
step_lexer_fuel: u64
Maximum lexer fuel for computation of the whole token mask. Default: 500_000 (~10ms)
step_max_items: usize
Number of Earley items created for the whole token mask. Default: 100_000 (~3ms)
max_lexer_states: usize
Maximum number of lexer states. Default: 10_000
max_grammar_size: usize
Maximum size of the grammar (symbols in productions) Default: 500_000 (a few megabytes of JSON)
Trait Implementations§
§impl Clone for ParserLimits
impl Clone for ParserLimits
§fn clone(&self) -> ParserLimits
fn clone(&self) -> ParserLimits
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Returns the “default value” for a type. Read more
§impl<'de> Deserialize<'de> for ParserLimits
impl<'de> Deserialize<'de> for ParserLimits
§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>,
Deserialize this value from the given Serde deserializer. Read more
§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,
Serialize this value into the given Serde serializer. Read more
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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,
Forward to the method defined on the type
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,
Forward to the method defined on the type
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> ⓘ
Converts
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> ⓘ
Converts
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<T> Pointable for T
impl<T> Pointable for T
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>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.