pub struct ResourceLimits {
pub max_source_size_bytes: usize,
pub max_expression_depth: usize,
pub max_expression_count: usize,
pub max_total_expression_count: usize,
pub max_data_value_bytes: usize,
pub max_loaded_bytes: usize,
pub max_sources: 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_total_expression_count: usizeMaximum total expression nodes across all sources (engine-level) The real capacity ceiling. pi (~3.1M) — generous for national-scale regulatory systems while bounding total engine workload.
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)
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 moreSource§impl Debug for ResourceLimits
impl Debug for ResourceLimits
Auto Trait Implementations§
impl Freeze for ResourceLimits
impl RefUnwindSafe for ResourceLimits
impl Send for ResourceLimits
impl Sync for ResourceLimits
impl Unpin for ResourceLimits
impl UnsafeUnpin for ResourceLimits
impl UnwindSafe for ResourceLimits
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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