pub struct CheckResult {
pub check_id: String,
pub check_name: String,
pub severity: Severity,
pub message: String,
pub suggestion: Option<String>,
pub location: Option<(String, Option<usize>)>,
}Fields§
§check_id: StringMachine-readable check id, e.g. discovery.description_length.
Surfaced by the machine-readable report format consumed by tests;
not yet read by the human renderer.
check_name: StringHuman label, e.g. SKILL.md description is under 1,536 characters.
severity: Severity§message: StringShort status line. For failures this is the what’s wrong.
suggestion: Option<String>The actionable fix, per design §8.1 “Errors teach, not just complain”.
Populated on Warn/Error; the one-liner suggestion.
location: Option<(String, Option<usize>)>File + line where the problem lives, when we can pin it down. Line is
1-based, None if file-level only.
Implementations§
Source§impl CheckResult
impl CheckResult
Sourcepub fn pass(
check_id: &str,
check_name: &str,
message: impl Into<String>,
) -> Self
pub fn pass( check_id: &str, check_name: &str, message: impl Into<String>, ) -> Self
A clean pass with no suggestion needed.
pub fn warn( check_id: &str, check_name: &str, message: impl Into<String>, suggestion: impl Into<String>, ) -> Self
pub fn fail( check_id: &str, check_name: &str, message: impl Into<String>, suggestion: impl Into<String>, ) -> Self
pub fn skipped( check_id: &str, check_name: &str, message: impl Into<String>, ) -> Self
Sourcepub fn is_critical_failure(&self) -> bool
pub fn is_critical_failure(&self) -> bool
True if this result fails verify (critical severity).
Trait Implementations§
Source§impl Clone for CheckResult
impl Clone for CheckResult
Source§fn clone(&self) -> CheckResult
fn clone(&self) -> CheckResult
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 moreAuto Trait Implementations§
impl Freeze for CheckResult
impl RefUnwindSafe for CheckResult
impl Send for CheckResult
impl Sync for CheckResult
impl Unpin for CheckResult
impl UnsafeUnpin for CheckResult
impl UnwindSafe for CheckResult
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