pub struct PolicyFinding {
pub code: &'static str,
pub message: String,
pub path: Option<EventPath>,
pub location: Option<FindingLocation>,
pub fix_available: bool,
}Expand description
What:
One thing a policy reports.
A struct is a record with named fields;
String is
owned UTF-8 text;
Option<T> is “a value or nothing”;
&'static str is text
baked into the program.
Why:
A policy describes what it found;
the engine adds the trigger,
the policy name
and the configured severity when it turns the finding into an event.
In TS you’d write (pseudocode):
type PolicyFinding = { code: string; message: string; path?: EventPath; location?: FindingLocation; patch?: PolicyPatch };Fields§
§code: &'static strThe policy-local code, lower-case words joined by hyphens.
message: StringThe explanation for the person who ran the command.
path: Option<EventPath>The repository path the finding is about, when it has one.
location: Option<FindingLocation>The byte range the finding is about, when it has one.
fix_available: boolWhether the policy proposed a correction for this finding.
Trait Implementations§
Source§impl Clone for PolicyFinding
impl Clone for PolicyFinding
Source§impl Debug for PolicyFinding
impl Debug for PolicyFinding
impl Eq for PolicyFinding
Source§impl PartialEq for PolicyFinding
impl PartialEq for PolicyFinding
impl StructuralPartialEq for PolicyFinding
Auto Trait Implementations§
impl Freeze for PolicyFinding
impl RefUnwindSafe for PolicyFinding
impl Send for PolicyFinding
impl Sync for PolicyFinding
impl Unpin for PolicyFinding
impl UnsafeUnpin for PolicyFinding
impl UnwindSafe for PolicyFinding
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<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
Compare self to
key and return true if they are equal.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