pub struct ResourceLimits {
pub max_file_size_bytes: usize,
pub max_expression_depth: usize,
pub max_fact_value_bytes: usize,
pub max_evaluation_time_ms: u64,
}Expand description
Resource limits to prevent abuse and enable predictable memory usage
These limits protect against malicious inputs while being generous enough for all legitimate use cases.
Fields§
§max_file_size_bytes: usizeMaximum file size in bytes Real usage: ~5KB, Limit: 5MB (1000x)
max_expression_depth: usizeMaximum expression nesting depth Real usage: ~3 levels, Limit: 100 (30x+)
max_fact_value_bytes: usizeMaximum size of a single fact value in bytes Real usage: ~100 bytes, Limit: 1KB (10x) Enables server pre-allocation for zero-allocation evaluation
max_evaluation_time_ms: u64Maximum evaluation time in milliseconds Real usage: ~1-10ms, Limit: 1000ms (100-1000x)
Implementations§
Trait Implementations§
Source§impl Clone for ResourceLimits
impl Clone for ResourceLimits
Source§fn clone(&self) -> ResourceLimits
fn clone(&self) -> ResourceLimits
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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