pub trait IdentifiedFinding: Serialize {
// Required methods
fn rule_token(&self) -> &'static str;
fn identity_parts(&self, paths: &IdentityPaths<'_>) -> Vec<String>;
fn tiebreak_position(&self) -> (u32, u32, u32);
fn finding_id(&self) -> Option<&str>;
fn set_finding_id(&mut self, id: Option<String>);
// Provided method
fn canonical_key(&self, paths: &IdentityPaths<'_>) -> String { ... }
}Expand description
A dead-code finding that carries a stable finding_id.
Required Methods§
Sourcefn rule_token(&self) -> &'static str
fn rule_token(&self) -> &'static str
The canonical issue code of this finding.
Sourcefn identity_parts(&self, paths: &IdentityPaths<'_>) -> Vec<String>
fn identity_parts(&self, paths: &IdentityPaths<'_>) -> Vec<String>
The parts that name the subject of this finding. Never a line or a column.
Sourcefn 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.
Sourcefn finding_id(&self) -> Option<&str>
fn finding_id(&self) -> Option<&str>
The stamped id, or None before the stamping pass.
Sourcefn set_finding_id(&mut self, id: Option<String>)
fn set_finding_id(&mut self, id: Option<String>)
Write the id.
Provided Methods§
Sourcefn 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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".