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_list_rows: usize,
pub max_list_depth: usize,
pub max_list_nodes: 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. For a value list each item is checked;
the list itself is bounded by max_list_rows, max_list_depth, max_list_nodes.
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. Rule references count as one cell: rule references are evaluation boundaries, so this bounds only intra-rule IR size. 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 the depth of the walks 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_list_rows: usizeMaximum rows in one list (evaluation-data bind).
max_list_depth: usizeMaximum nested self-list depth, the spec holding the list being level 1.
max_list_nodes: usizeMaximum total rows across one evaluation-data list tree.