pub struct AuditReport {
pub gates: Vec<GateResult>,
}Expand description
Aggregate audit report.
Fields§
§gates: Vec<GateResult>Per-gate results in registration order.
Implementations§
Source§impl AuditReport
impl AuditReport
Sourcepub fn max_severity(&self) -> Option<Severity>
pub fn max_severity(&self) -> Option<Severity>
Returns the highest severity present across all gates, or None
if no findings were produced.
§Examples
use ssg::audit::AuditReport;
let r = AuditReport { gates: vec![] };
assert!(r.max_severity().is_none());Sourcepub fn should_fail(&self, fail_on: Severity) -> bool
pub fn should_fail(&self, fail_on: Severity) -> bool
Returns true when the report contains at least one finding at
fail_on or higher.
§Examples
use ssg::audit::{AuditReport, Severity};
let r = AuditReport { gates: vec![] };
assert!(!r.should_fail(Severity::Error));Sourcepub const fn len(&self) -> usize
pub const fn len(&self) -> usize
Total number of registered gates (skipped or not).
§Examples
use ssg::audit::AuditReport;
let r = AuditReport { gates: vec![] };
assert_eq!(r.len(), 0);Sourcepub const fn is_empty(&self) -> bool
pub const fn is_empty(&self) -> bool
true when no gates ran.
§Examples
use ssg::audit::AuditReport;
let r = AuditReport { gates: vec![] };
assert!(r.is_empty());Sourcepub fn print_text(&self)
pub fn print_text(&self)
Convenience: prints the rich text formatter to stdout.
§Examples
use ssg::audit::AuditReport;
let r = AuditReport { gates: vec![] };
r.print_text(); // emits nothing for an empty reportSourcepub fn print_json(&self) -> Result<(), SsgError>
pub fn print_json(&self) -> Result<(), SsgError>
Convenience: prints the JSON formatter to stdout.
§Errors
Propagates any JSON serialisation error from
crate::audit::output::json::format.
§Examples
use ssg::audit::AuditReport;
let r = AuditReport { gates: vec![] };
r.print_json().unwrap();Sourcepub fn print_junit(&self)
pub fn print_junit(&self)
Convenience: prints the JUnit XML formatter to stdout.
§Examples
use ssg::audit::AuditReport;
let r = AuditReport { gates: vec![] };
r.print_junit();Sourcepub fn print_sarif(&self)
pub fn print_sarif(&self)
Convenience: prints the SARIF v2.1.0 formatter to stdout (#562).
§Examples
use ssg::audit::AuditReport;
let r = AuditReport { gates: vec![] };
r.print_sarif();Trait Implementations§
Source§impl Clone for AuditReport
impl Clone for AuditReport
Source§fn clone(&self) -> AuditReport
fn clone(&self) -> AuditReport
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 AuditReport
impl Debug for AuditReport
Source§impl<'de> Deserialize<'de> for AuditReport
impl<'de> Deserialize<'de> for AuditReport
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 AuditReport
impl RefUnwindSafe for AuditReport
impl Send for AuditReport
impl Sync for AuditReport
impl Unpin for AuditReport
impl UnsafeUnpin for AuditReport
impl UnwindSafe for AuditReport
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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