pub struct ComplexityGuardOptions {
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_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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ComplexityGuardOptions
Source§impl Debug for ComplexityGuardOptions
impl Debug for ComplexityGuardOptions
Source§impl Default for ComplexityGuardOptions
impl Default for ComplexityGuardOptions
Source§impl<'de> Deserialize<'de> for ComplexityGuardOptions
impl<'de> Deserialize<'de> for ComplexityGuardOptions
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ComplexityGuardOptions
Source§impl PartialEq for ComplexityGuardOptions
impl PartialEq for ComplexityGuardOptions
Source§fn eq(&self, other: &ComplexityGuardOptions) -> bool
fn eq(&self, other: &ComplexityGuardOptions) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ComplexityGuardOptions
impl Serialize for ComplexityGuardOptions
impl StructuralPartialEq for ComplexityGuardOptions
Auto Trait Implementations§
impl Freeze for ComplexityGuardOptions
impl RefUnwindSafe for ComplexityGuardOptions
impl Send for ComplexityGuardOptions
impl Sync for ComplexityGuardOptions
impl Unpin for ComplexityGuardOptions
impl UnsafeUnpin for ComplexityGuardOptions
impl UnwindSafe for ComplexityGuardOptions
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