pub struct PolicyViolationFinding {
pub violation: PolicyViolation,
pub finding_id: Option<String>,
pub actions: Vec<IssueAction>,
pub introduced: Option<AuditIntroduced>,
}Expand description
Wire-shape envelope for a PolicyViolation finding. Carries actions for
replacing the banned call, import, or effect, or suppressing it with a scoped
policy-violation:<pack>/<rule-id> token.
Fields§
§violation: PolicyViolationThe underlying rule-pack policy entry.
finding_id: Option<String>Stable id of this finding: dc1:<rule>:<16 hex digits>, with a
~<k> suffix when several findings of one type share an identity.
Line and column are not inputs, so the id survives line shifts,
reformats and reorders. A rename of the file or the symbol gives a
new id. Absent in output from older versions.
actions: Vec<IssueAction>Suggested next steps.
introduced: Option<AuditIntroduced>Set by the audit pass when this finding is introduced relative to the merge-base.
Implementations§
Source§impl PolicyViolationFinding
impl PolicyViolationFinding
Sourcepub fn with_actions(violation: PolicyViolation) -> Self
pub fn with_actions(violation: PolicyViolation) -> Self
Build the wrapper from a raw PolicyViolation.
Trait Implementations§
Source§impl Clone for PolicyViolationFinding
impl Clone for PolicyViolationFinding
Source§impl Debug for PolicyViolationFinding
impl Debug for PolicyViolationFinding
Source§impl<'de> Deserialize<'de> for PolicyViolationFinding
impl<'de> Deserialize<'de> for PolicyViolationFinding
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl IdentifiedFinding for PolicyViolationFinding
impl IdentifiedFinding for PolicyViolationFinding
Source§fn rule_token(&self) -> &'static str
fn rule_token(&self) -> &'static str
The canonical issue code of this finding.
Source§fn identity_parts(&self, p: &IdentityPaths<'_>) -> Vec<String>
fn identity_parts(&self, p: &IdentityPaths<'_>) -> Vec<String>
The parts that name the subject of this finding. Never a line or a
column.
Source§fn tiebreak_position(&self) -> (u32, u32, u32)
fn tiebreak_position(&self) -> (u32, u32, u32)
Line, column and span start. Used only to order findings that share
a base id.
Source§fn finding_id(&self) -> Option<&str>
fn finding_id(&self) -> Option<&str>
The stamped id, or
None before the stamping pass.Source§fn set_finding_id(&mut self, id: Option<String>)
fn set_finding_id(&mut self, id: Option<String>)
Write the id.
Source§fn canonical_key(&self, paths: &IdentityPaths<'_>) -> String
fn canonical_key(&self, paths: &IdentityPaths<'_>) -> String
The canonical key of this finding: the readable form of the id input.
See
dead_code_canonical_key.Auto Trait Implementations§
impl Freeze for PolicyViolationFinding
impl RefUnwindSafe for PolicyViolationFinding
impl Send for PolicyViolationFinding
impl Sync for PolicyViolationFinding
impl Unpin for PolicyViolationFinding
impl UnsafeUnpin for PolicyViolationFinding
impl UnwindSafe for PolicyViolationFinding
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