pub struct LintFinding {
pub rule_id: String,
pub severity: LintSeverity,
pub category: LintCategory,
pub message: String,
pub node_id: Option<String>,
pub suggestion: Option<String>,
pub line: Option<usize>,
}Expand description
A single lint finding
Fields§
§rule_id: StringRule that triggered this finding
severity: LintSeveritySeverity level
category: LintCategoryCategory of the rule
message: StringHuman-readable message
node_id: Option<String>Optional node ID where the issue was found
suggestion: Option<String>Optional suggestion for fixing the issue
line: Option<usize>Line number (if applicable)
Implementations§
Source§impl LintFinding
impl LintFinding
Sourcepub fn new(
rule_id: impl Into<String>,
severity: LintSeverity,
category: LintCategory,
message: impl Into<String>,
) -> Self
pub fn new( rule_id: impl Into<String>, severity: LintSeverity, category: LintCategory, message: impl Into<String>, ) -> Self
Create a new lint finding
Sourcepub fn with_node_id(self, node_id: impl Into<String>) -> Self
pub fn with_node_id(self, node_id: impl Into<String>) -> Self
Set the node ID where the issue was found
Sourcepub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
pub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
Add a suggestion for fixing the issue
Trait Implementations§
Source§impl Clone for LintFinding
impl Clone for LintFinding
Source§fn clone(&self) -> LintFinding
fn clone(&self) -> LintFinding
Returns a duplicate of the value. Read more
1.0.0 · 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 LintFinding
impl Debug for LintFinding
Source§impl<'de> Deserialize<'de> for LintFinding
impl<'de> Deserialize<'de> for LintFinding
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
Auto Trait Implementations§
impl Freeze for LintFinding
impl RefUnwindSafe for LintFinding
impl Send for LintFinding
impl Sync for LintFinding
impl Unpin for LintFinding
impl UnwindSafe for LintFinding
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