#[non_exhaustive]pub struct EvalLimits {
pub max_func_args: u32,
pub max_str_size: u32,
pub max_list_len: u32,
pub max_iterations: u32,
pub max_file_bytes: u32,
}Expand description
Per-call resource limits enforced by the evaluator and its registered functions.
Per 70-security.md § 3.2 every cap is configurable; the defaults match
the spec. Breaching any returns Err(EvalError::Limit { kind, ... }) —
never a panic.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_func_args: u32Maximum positional+variadic arg count per function call. Default: 64.
max_str_size: u32Maximum rendered string size returned by a function (bytes). Default: 1 MiB.
max_list_len: u32Maximum list/array size returned by a function. Default: 100 000.
max_iterations: u32Maximum reduction iterations across a single evaluate call.
Default: 1 000 000. Anti-DoS bound for nested for / recursive
templates.
max_file_bytes: u32Maximum read size for sandboxed file functions (bytes). Default: 4 MiB (matches the loader’s per-file cap).
Trait Implementations§
Source§impl Clone for EvalLimits
impl Clone for EvalLimits
Source§fn clone(&self) -> EvalLimits
fn clone(&self) -> EvalLimits
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 moreSource§impl Debug for EvalLimits
impl Debug for EvalLimits
Source§impl Default for EvalLimits
impl Default for EvalLimits
Source§impl<'de> Deserialize<'de> for EvalLimits
impl<'de> Deserialize<'de> for EvalLimits
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
Source§impl Hash for EvalLimits
impl Hash for EvalLimits
Source§impl PartialEq for EvalLimits
impl PartialEq for EvalLimits
Source§fn eq(&self, other: &EvalLimits) -> bool
fn eq(&self, other: &EvalLimits) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for EvalLimits
impl Serialize for EvalLimits
impl Copy for EvalLimits
impl Eq for EvalLimits
impl StructuralPartialEq for EvalLimits
Auto Trait Implementations§
impl Freeze for EvalLimits
impl RefUnwindSafe for EvalLimits
impl Send for EvalLimits
impl Sync for EvalLimits
impl Unpin for EvalLimits
impl UnsafeUnpin for EvalLimits
impl UnwindSafe for EvalLimits
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.