pub struct RuleResult {
pub rule_id: Arc<str>,
pub level: Level,
pub policy_url: Option<Arc<str>>,
pub violations: Vec<Violation>,
pub notes: Vec<Violation>,
pub is_fixable: bool,
}Expand description
The collected outcome of evaluating a single rule.
rule_id holds an Arc<str>: the engine builds it once
per rule run and shares it across every violation that rule
produces, saving N-1 allocations per rule. policy_url
follows the same shape via Arc<str> — set once per rule,
shared across violations.
Fields§
§rule_id: Arc<str>§level: Level§policy_url: Option<Arc<str>>§violations: Vec<Violation>§notes: Vec<Violation>Informational notes (non-violation findings) the rule
produced — e.g. entries it skipped rather than failed on.
Partitioned out of the rule’s raw output by
RuleResult::new; never counted in pass/fail.
is_fixable: boolWhether the rule declares a Fixer — surfaced here so
the human formatter can tag violations as fixable
without threading the rule registry into the renderer.
Implementations§
Source§impl RuleResult
impl RuleResult
Sourcepub fn new(
rule_id: Arc<str>,
level: Level,
policy_url: Option<Arc<str>>,
raw: Vec<Violation>,
is_fixable: bool,
) -> Self
pub fn new( rule_id: Arc<str>, level: Level, policy_url: Option<Arc<str>>, raw: Vec<Violation>, is_fixable: bool, ) -> Self
Build a result from a rule’s raw output, partitioning
note-flagged Violations (is_note) into notes
and the rest into violations. Centralises
the note/violation split so pass/fail and formatters only ever
see real violations in violations.
pub fn passed(&self) -> bool
Trait Implementations§
Source§impl Clone for RuleResult
impl Clone for RuleResult
Source§fn clone(&self) -> RuleResult
fn clone(&self) -> RuleResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for RuleResult
impl RefUnwindSafe for RuleResult
impl Send for RuleResult
impl Sync for RuleResult
impl Unpin for RuleResult
impl UnsafeUnpin for RuleResult
impl UnwindSafe for RuleResult
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<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>
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>
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