pub struct ResourceLimits {
pub max_source_size_bytes: usize,
pub max_expression_depth: usize,
pub max_expression_count: usize,
pub max_data_value_bytes: usize,
pub max_loaded_bytes: usize,
pub max_sources: usize,
pub max_normalized_expression_nodes: usize,
pub max_spec_dependency_depth: usize,
pub max_dag_specs: usize,
pub max_normal_form_depth: usize,
}Expand description
Limits to prevent abuse and enable predictable resource usage
These limits protect against malicious inputs while being generous enough for all legitimate use cases.
Fields§
§max_source_size_bytes: usizeMaximum size of one loaded source text in bytes. Real usage: ~5KB, Limit: 5MB (1000x)
max_expression_depth: usizeMaximum expression nesting depth Real usage: ~3 levels, Limit: 7. Deeper logic via rule composition.
max_expression_count: usizeMaximum expression nodes per source (parser-level) Quick-reject for pathological single sources.
max_data_value_bytes: usizeMaximum size of a single data value in bytes Real usage: ~100 bytes, Limit: 1KB (10x) Enables server pre-allocation for zero-allocation evaluation
max_loaded_bytes: usizeMaximum total bytes to load in one batch (and/or in-memory size of loaded specs)
max_sources: usizeMaximum number of sources in one load batch (e.g. after expanding paths on disk)
max_normalized_expression_nodes: usizeMaximum unique normal-form cells reachable from one rule root in the shared graph after normalize. Bounds planning work and shipped table size. Default: 30,000.
max_spec_dependency_depth: usizeMaximum depth of the spec dependency chain (uses imports) from the
root spec. Bounds recursion in dependency discovery and graph building.
Real usage: ~3 levels, Limit: 32 (10x).
max_dag_specs: usizeMaximum number of specs in one dependency DAG (the root spec plus all transitive dependencies). Bounds per-plan memory and planning work.
max_normal_form_depth: usizeMaximum nesting depth of a rule’s normalized NormalForm DAG (leaves = depth 1). The evaluator walks recursively, so planning must guarantee no rule root can overflow the stack at run time. Lemma’s runtime does not return errors — this limit is the guarantee.
Trait Implementations§
Source§impl Clone for ResourceLimits
impl Clone for ResourceLimits
Source§fn clone(&self) -> ResourceLimits
fn clone(&self) -> ResourceLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more