pub struct FailOnPolicy { /* private fields */ }Expand description
The set of categories that turn at least one matching CheckFinding into a
process-exit-1 policy violation (FR-009/FR-010).
Implementations§
Source§impl FailOnPolicy
impl FailOnPolicy
Sourcepub const fn new(categories: Vec<Category>) -> Self
pub const fn new(categories: Vec<Category>) -> Self
Builds a policy from an explicit category list.
Sourcepub fn default_categories() -> Self
pub fn default_categories() -> Self
The default policy (FR-010): vulnerable,yanked,unsatisfiable — the categories that
represent a broken or unsafe build, as opposed to advisory-only categories.
§Examples
use deps_cli::report::{Category, FailOnPolicy};
let policy = FailOnPolicy::default_categories();
assert!(policy.categories().contains(&Category::Vulnerable));
assert!(!policy.categories().contains(&Category::Outdated));Sourcepub fn categories(&self) -> &[Category]
pub fn categories(&self) -> &[Category]
The categories this policy fails on.
Sourcepub fn matches(&self, findings: &[CheckFinding]) -> bool
pub fn matches(&self, findings: &[CheckFinding]) -> bool
Whether any finding in findings matches this policy.
Trait Implementations§
Source§impl Clone for FailOnPolicy
impl Clone for FailOnPolicy
Source§impl Debug for FailOnPolicy
impl Debug for FailOnPolicy
Auto Trait Implementations§
impl Freeze for FailOnPolicy
impl RefUnwindSafe for FailOnPolicy
impl Send for FailOnPolicy
impl Sync for FailOnPolicy
impl Unpin for FailOnPolicy
impl UnsafeUnpin for FailOnPolicy
impl UnwindSafe for FailOnPolicy
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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