pub struct Limits {
pub rule_timeout: Duration,
pub global_timeout: Duration,
pub memory_bytes: usize,
}Expand description
The three budgets.
Fields§
§rule_timeout: DurationBudget for one handler invocation — a single check or reduce call.
This is the limit that fires fast and names the culprit: which rule, which file, which phase. Keeping it well under the global budget means the diagnostic usually comes from the level that can identify the cause.
global_timeout: DurationWall-clock budget for the whole run.
The backstop for when no single invocation is pathological but the aggregate is — a thousand rules each taking twenty milliseconds.
memory_bytes: usizeMemory ceiling per runtime.
Implementations§
Source§impl Limits
impl Limits
Sourcepub const fn with_rule_timeout(self, timeout: Duration) -> Self
pub const fn with_rule_timeout(self, timeout: Duration) -> Self
Raise the per-invocation budget, for a rule that legitimately does heavy work.
Cannot raise the global budget: a single rule must not be able to extend the run’s total. That is the whole point of having two levels rather than one.
Sourcepub const fn with_global_timeout(self, timeout: Duration) -> Self
pub const fn with_global_timeout(self, timeout: Duration) -> Self
Set the global wall-clock budget.
Sourcepub const fn with_memory_bytes(self, bytes: usize) -> Self
pub const fn with_memory_bytes(self, bytes: usize) -> Self
Set the per-runtime memory ceiling.