pub struct Finding {
pub severity: Severity,
pub rule: &'static str,
pub message: String,
pub location: Option<SourceLocation>,
}Expand description
One lint finding.
Fields§
§severity: SeveritySeverity classification.
rule: &'static strStable rule identifier (used for filter / deny / explain).
message: StringHuman-readable message.
location: Option<SourceLocation>Optional source location.
Implementations§
Source§impl Finding
impl Finding
Sourcepub fn error(rule: &'static str, message: impl Into<String>) -> Self
pub fn error(rule: &'static str, message: impl Into<String>) -> Self
Build an error-severity finding.
Sourcepub fn warning(rule: &'static str, message: impl Into<String>) -> Self
pub fn warning(rule: &'static str, message: impl Into<String>) -> Self
Build a warning-severity finding.
Sourcepub fn lint_at_plan(rule: &'static str, message: impl Into<String>) -> Self
pub fn lint_at_plan(rule: &'static str, message: impl Into<String>) -> Self
Build a lint-at-plan-severity finding.
Sourcepub fn at(self, loc: SourceLocation) -> Self
pub fn at(self, loc: SourceLocation) -> Self
Attach a source location.
Trait Implementations§
impl Eq for Finding
impl StructuralPartialEq for Finding
Auto Trait Implementations§
impl Freeze for Finding
impl RefUnwindSafe for Finding
impl Send for Finding
impl Sync for Finding
impl Unpin for Finding
impl UnsafeUnpin for Finding
impl UnwindSafe for Finding
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<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