pub struct CheckReport {
pub check: String,
pub result: Result<CheckRun, ExecutionError>,
}Expand description
Aggregated result of running a check.
Wraps the raw check output (Result<Vec<Evaluation>, ExecutionError>)
with summary counts and the check name.
use scute_core::report::CheckReport;
use scute_core::{Evaluation, Thresholds};
let evals = vec![Evaluation::completed(
"feat: add login",
0,
Thresholds { warn: None, fail: Some(0) },
vec![],
)];
let report = CheckReport::new("commit-message", Ok(evals));
assert!(!report.has_failures());Fields§
§check: String§result: Result<CheckRun, ExecutionError>Implementations§
Source§impl CheckReport
impl CheckReport
Sourcepub fn new(
check_name: &str,
result: Result<Vec<Evaluation>, ExecutionError>,
) -> Self
pub fn new( check_name: &str, result: Result<Vec<Evaluation>, ExecutionError>, ) -> Self
Create a report from raw check output, computing the Summary.
Sourcepub fn has_failures(&self) -> bool
pub fn has_failures(&self) -> bool
True when any evaluation resolved to Status::Fail.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
True when the check itself failed to run, or any evaluation errored.
Auto Trait Implementations§
impl Freeze for CheckReport
impl RefUnwindSafe for CheckReport
impl Send for CheckReport
impl Sync for CheckReport
impl Unpin for CheckReport
impl UnsafeUnpin for CheckReport
impl UnwindSafe for CheckReport
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