pub enum RunFailure {
PolicyViolation(String),
Tool(String),
}Expand description
A typed failure returned by run.
The distinction lets callers map policy violations to exit 1 and all other failures (usage errors, I/O errors, internal errors) to exit 2, matching the stable exit-code contract:
0 = ran to completion: clean, or advisory findings
1 = ran to completion: no-new-debt policy found new/worsened coverage gaps
2 = tool did not complete a review: usage, input/IO, or internal errorVariants§
PolicyViolation(String)
The tool ran to completion and the no-new-debt policy found new or worsened coverage gaps.
Tool(String)
The tool did not complete a review: usage error, missing/unreadable input, I/O error, or internal error.
Trait Implementations§
Source§impl Display for RunFailure
impl Display for RunFailure
Source§impl From<String> for RunFailure
Converts a plain String error into the RunFailure::Tool variant so
that the hundreds of existing ?-propagated String error sites remain
unchanged.
impl From<String> for RunFailure
Converts a plain String error into the RunFailure::Tool variant so
that the hundreds of existing ?-propagated String error sites remain
unchanged.
Auto Trait Implementations§
impl Freeze for RunFailure
impl RefUnwindSafe for RunFailure
impl Send for RunFailure
impl Sync for RunFailure
impl Unpin for RunFailure
impl UnsafeUnpin for RunFailure
impl UnwindSafe for RunFailure
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more