pub struct DiagnosticResult {
pub check_name: String,
pub status: CheckStatus,
pub message: String,
pub remediation: Option<String>,
}Expand description
One named diagnostic result with an optional suggested fix.
use limitless_cli::models::{CheckStatus, DiagnosticResult};
let mut result = DiagnosticResult::new(
"Env Audit",
CheckStatus::Warn,
".env.example is outdated",
);
assert!(!result.is_pass());
result.set_remediation("Update .env.example to match production keys");
assert!(result.remediation.is_some());Fields§
§check_name: StringShort name of the check, e.g. "Runtime Check" or "Env Audit".
status: CheckStatusOutcome of the check.
message: StringHuman-readable description of what the check found.
remediation: Option<String>Optional suggested fix. Omitted from JSON when None.
Implementations§
Source§impl DiagnosticResult
impl DiagnosticResult
Sourcepub fn new(
check_name: impl Into<String>,
status: CheckStatus,
message: impl Into<String>,
) -> Self
pub fn new( check_name: impl Into<String>, status: CheckStatus, message: impl Into<String>, ) -> Self
Creates a result without a remediation hint.
Sourcepub fn with_remediation(self, remediation: impl Into<String>) -> Self
pub fn with_remediation(self, remediation: impl Into<String>) -> Self
Builder-style: attaches a remediation hint and returns the result.
Sourcepub fn set_remediation(&mut self, remediation: impl Into<String>)
pub fn set_remediation(&mut self, remediation: impl Into<String>)
Sets (or replaces) the remediation hint in place.
Trait Implementations§
Source§impl Clone for DiagnosticResult
impl Clone for DiagnosticResult
Source§impl Debug for DiagnosticResult
impl Debug for DiagnosticResult
Source§impl<'de> Deserialize<'de> for DiagnosticResult
impl<'de> Deserialize<'de> for DiagnosticResult
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
impl Eq for DiagnosticResult
Source§impl PartialEq for DiagnosticResult
impl PartialEq for DiagnosticResult
Source§impl Serialize for DiagnosticResult
impl Serialize for DiagnosticResult
impl StructuralPartialEq for DiagnosticResult
Auto Trait Implementations§
impl Forget for DiagnosticResult
impl Freeze for DiagnosticResult
impl RefUnwindSafe for DiagnosticResult
impl Send for DiagnosticResult
impl Sync for DiagnosticResult
impl Unpin for DiagnosticResult
impl UnsafeUnpin for DiagnosticResult
impl UnwindSafe for DiagnosticResult
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