pub enum SandboxError {
RuleTimeout {
budget: Duration,
},
RunTimeout {
budget: Duration,
elapsed: Duration,
},
MemoryExceeded {
limit_bytes: usize,
},
Script {
message: String,
stack: Option<String>,
},
NonErrorThrown,
Engine(String),
}Expand description
A failure inside the sandbox.
Every variant here aborts the run. Skipping the offending rule and continuing is the friendlier-looking behavior and is wrong: a timeout is timing-dependent, so a rule that trips on a loaded machine and not on an idle one would make output vary between runs on identical input — the property the rest of the design works to prevent. A checker that could not finish must not be mistaken for one that found nothing.
Variants§
RuleTimeout
One handler invocation exceeded its budget.
RunTimeout
The run as a whole exceeded its wall-clock budget.
Fields
MemoryExceeded
The runtime hit its memory ceiling.
Script
The rule threw, or failed to parse.
Fields
NonErrorThrown
The rule threw something that is not an Error.
Engine(String)
The engine failed for a reason lanekeep does not model.
Implementations§
Source§impl SandboxError
impl SandboxError
Sourcepub const fn is_limit_breach(&self) -> bool
pub const fn is_limit_breach(&self) -> bool
Whether this failure came from a breached limit rather than from rule logic.
Both cancel the run. The distinction is for the diagnostic: a limit breach is a budget problem, a thrown error is a bug in the rule.
Trait Implementations§
Source§impl Clone for SandboxError
impl Clone for SandboxError
Source§fn clone(&self) -> SandboxError
fn clone(&self) -> SandboxError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SandboxError
impl Debug for SandboxError
Source§impl Display for SandboxError
impl Display for SandboxError
impl Eq for SandboxError
Source§impl Error for SandboxError
impl Error for SandboxError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for SandboxError
impl PartialEq for SandboxError
impl StructuralPartialEq for SandboxError
Auto Trait Implementations§
impl Freeze for SandboxError
impl RefUnwindSafe for SandboxError
impl Send for SandboxError
impl Sync for SandboxError
impl Unpin for SandboxError
impl UnsafeUnpin for SandboxError
impl UnwindSafe for SandboxError
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.