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) -> PolicyViolationFinding
pub fn with_actions(violation: PolicyViolation) -> PolicyViolationFinding
Build the wrapper from a raw PolicyViolation.
Trait Implementations§
Source§impl Clone for PolicyViolationFinding
impl Clone for PolicyViolationFinding
Source§fn clone(&self) -> PolicyViolationFinding
fn clone(&self) -> PolicyViolationFinding
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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<PolicyViolationFinding, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PolicyViolationFinding, <__D as Deserializer<'de>>::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.Source§impl JsonSchema for PolicyViolationFinding
impl JsonSchema for PolicyViolationFinding
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Serialize for PolicyViolationFinding
impl Serialize for PolicyViolationFinding
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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