#[non_exhaustive]pub struct EvalLimits {
pub steps_per_rule: u64,
pub max_depth: usize,
pub total_steps: u64,
}Expand description
How much work rule evaluation may do on one model.
A WHERE rule can call FUNCTIONs that loop and recurse, over data a user
did not write. These limits turn a pathological file into typed
BudgetExceeded results instead of a hang or a stack overflow:
Self::steps_per_rulebounds one rule on one instance (each expression node and statement is a step); exceeding it reports that rule on that instance as not evaluated and moves on;Self::max_depthbounds nested FUNCTION calls and derived attributes, which is what keeps the native stack safe;Self::total_stepsbounds the whole run; exceeding it stops rule evaluation and marks the report truncated.
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.steps_per_rule: u64Steps one rule may take on one instance.
max_depth: usizeNesting of FUNCTION calls and derived attributes.
total_steps: u64Steps the whole run may take.
Implementations§
Source§impl EvalLimits
impl EvalLimits
Sourcepub const DEFAULT: Self
pub const DEFAULT: Self
Generous for real files: the IFC rules take tens to a few thousand steps per instance, and nest a handful of calls deep.
Sourcepub const fn with_steps_per_rule(self, steps: u64) -> Self
pub const fn with_steps_per_rule(self, steps: u64) -> Self
These limits with a different per-rule step limit.
Sourcepub const fn with_max_depth(self, depth: usize) -> Self
pub const fn with_max_depth(self, depth: usize) -> Self
These limits with a different nesting limit.
Sourcepub const fn with_total_steps(self, steps: u64) -> Self
pub const fn with_total_steps(self, steps: u64) -> Self
These limits with a different limit for the whole run.
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 moreimpl Copy for EvalLimits
Source§impl Debug for EvalLimits
impl Debug for EvalLimits
Source§impl Default for EvalLimits
impl Default for EvalLimits
impl Eq for EvalLimits
Source§impl PartialEq for EvalLimits
impl PartialEq 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