pub struct CheckResult {
pub plugin: String,
pub check: String,
pub severity: Severity,
pub message: String,
pub details: Option<String>,
}Expand description
Check result struct Each cradle check should return this struct after execution
Fields§
§plugin: StringCalling plugin name
check: StringCheck name
severity: SeverityResult severity (see: Severity)
message: StringMessage included in the check’s result
details: Option<String>Optional details for the message
Implementations§
Source§impl CheckResult
impl CheckResult
Sourcepub fn pass(plugin: &str, check: &str, message: impl Into<String>) -> Self
pub fn pass(plugin: &str, check: &str, message: impl Into<String>) -> Self
Small helper to create a pass result (Severity::Pass)
Sourcepub fn info(plugin: &str, check: &str, message: impl Into<String>) -> Self
pub fn info(plugin: &str, check: &str, message: impl Into<String>) -> Self
Small helper to create an informational result (Severity::Info)
Sourcepub fn warn(plugin: &str, check: &str, message: impl Into<String>) -> Self
pub fn warn(plugin: &str, check: &str, message: impl Into<String>) -> Self
Small helper to create a warning result (Severity::Warn)
Sourcepub fn fail(plugin: &str, check: &str, message: impl Into<String>) -> Self
pub fn fail(plugin: &str, check: &str, message: impl Into<String>) -> Self
Small helper to create a failure result (Severity::Fail)
Sourcepub fn critical(plugin: &str, check: &str, message: impl Into<String>) -> Self
pub fn critical(plugin: &str, check: &str, message: impl Into<String>) -> Self
Small helper to create a critical error result (Severity::Critical)
Sourcepub fn with_details(self, details: impl Into<String>) -> Self
pub fn with_details(self, details: impl Into<String>) -> Self
Adds details to the given check result
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 moreSource§impl Debug for CheckResult
impl Debug for CheckResult
Source§impl<'de> Deserialize<'de> for CheckResult
impl<'de> Deserialize<'de> for CheckResult
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 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