pub struct ComplexityGuardOptions {
pub max_parser_depth: Option<usize>,
pub max_input_bytes: Option<usize>,
pub max_tokens: Option<usize>,
pub max_ast_nodes: Option<usize>,
pub max_ast_depth: Option<usize>,
pub max_parenthesis_depth: Option<usize>,
pub max_function_call_depth: Option<usize>,
}Expand description
Guard options for parse/transpile/generate complexity.
These limits turn excessively deep or large inputs into regular errors instead of relying on process stack exhaustion as the failure mode.
Fields§
§max_parser_depth: Option<usize>Maximum logical nesting during parsing, before an AST exists.
Defaults to 32 on WASM and 1024 on native targets.
Raising this limit or disabling it with None can permit stack exhaustion.
max_input_bytes: Option<usize>Maximum allowed SQL input size in bytes.
None disables this check.
max_tokens: Option<usize>Maximum allowed number of tokens after tokenization.
None disables this check.
max_ast_nodes: Option<usize>Maximum allowed AST node count after parsing.
None disables this check.
max_ast_depth: Option<usize>Maximum allowed AST depth after parsing.
None disables this check.
max_parenthesis_depth: Option<usize>Maximum allowed nested parenthesis depth before parsing.
None disables this check.
max_function_call_depth: Option<usize>Maximum allowed nested function-call depth before parsing.
None disables this check.
Trait Implementations§
Source§impl Clone for ComplexityGuardOptions
impl Clone for ComplexityGuardOptions
Source§fn clone(&self) -> ComplexityGuardOptions
fn clone(&self) -> ComplexityGuardOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more