#[non_exhaustive]pub enum EngineError {
DeadlineExceeded {
partial_lint: LintResult,
},
InvalidThreshold(InvalidThreshold),
}Expand description
Runtime errors from Engine::lint_with_options /
Engine::fix_with_options (spec 005).
Distinct from EngineConstructionError by design — construction
errors are build-time configuration defects the integrator fixes
before shipping; EngineError reports runtime conditions (a
per-call deadline expired, a per-call threshold override is
out of range) the caller can react to. Keeping the two enums
separate means matching on one does not force callers to pattern
against build-time variants they could never encounter at
request time.
#[non_exhaustive] so future runtime conditions (memory budget
exceeded, per-rule deadline expired, cancellation token tripped)
can land without a semver-breaking change.
Spec §R5 (asymmetric response shape): the lint path does not
return EngineError::DeadlineExceeded on its own — partial lint
results are surfaced through LintResult.truncated instead, so
the caller can render whatever diagnostics were produced before
the abort. Only fix_with_options raises DeadlineExceeded,
because a partial FixResult would commit half a fix to the
audit stream (Constitution V Principle V).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DeadlineExceeded
fix_with_options aborted before applying every fix because
the call’s deadline expired. partial_lint is the
LintResult that the lint pass produced before the abort —
callers can render its diagnostics to the user even though no
fixes were committed. partial_lint.truncated indicates
whether the lint pass itself was also truncated (deadline
expired during scanning) versus the fix-application loop
(lint pass completed, fixes did not).
Carries the lint result by value (not boxed) because the
happy path returns Ok(FixResult) and the size penalty on
the error variant is paid only on the cold path.
Fields
partial_lint: LintResultInvalidThreshold(InvalidThreshold)
fix_with_options rejected the per-call confidence
threshold override. Wraps the existing standalone
InvalidThreshold struct so Engine::fix_with_threshold
can keep its Result<FixResult, InvalidThreshold> public
signature unchanged while internally routing through
fix_with_options.
Trait Implementations§
Source§impl Debug for EngineError
impl Debug for EngineError
Source§impl Display for EngineError
impl Display for EngineError
Source§impl Error for EngineError
impl Error for EngineError
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()