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) -> Limits
pub const fn with_rule_timeout(self, timeout: Duration) -> Limits
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) -> Limits
pub const fn with_global_timeout(self, timeout: Duration) -> Limits
Set the global wall-clock budget.
Sourcepub const fn with_memory_bytes(self, bytes: usize) -> Limits
pub const fn with_memory_bytes(self, bytes: usize) -> Limits
Set the per-runtime memory ceiling.
Trait Implementations§
impl Copy for Limits
impl Eq for Limits
impl StructuralPartialEq for Limits
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnsafeUnpin for Limits
impl UnwindSafe for Limits
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<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
key and return true if they are equal.