pub struct AuditRunner { /* private fields */ }Expand description
Orchestrates dispatch across the 15 registered gates.
Implementations§
Source§impl AuditRunner
impl AuditRunner
Sourcepub fn new(config: AuditConfig) -> Self
pub fn new(config: AuditConfig) -> Self
Constructs a runner with the 15 built-in gates registered.
§Examples
use ssg::audit::{AuditConfig, AuditRunner};
let r = AuditRunner::new(AuditConfig::new());
assert_eq!(r.gate_names().len(), 15);Sourcepub fn with_gates(config: AuditConfig, gates: Vec<Box<dyn AuditGate>>) -> Self
pub fn with_gates(config: AuditConfig, gates: Vec<Box<dyn AuditGate>>) -> Self
Constructs a runner with a user-supplied gate list (for tests).
§Examples
use ssg::audit::{AuditConfig, AuditRunner};
let r = AuditRunner::with_gates(AuditConfig::new(), Vec::new());
assert!(r.gate_names().is_empty());Sourcepub fn gate_names(&self) -> Vec<&'static str>
pub fn gate_names(&self) -> Vec<&'static str>
Returns the names of every gate registered with the runner.
§Examples
use ssg::audit::{AuditConfig, AuditRunner};
let r = AuditRunner::new(AuditConfig::new());
assert!(r.gate_names().contains(&"wcag"));Sourcepub fn run(&self, site: &Site) -> AuditReport
pub fn run(&self, site: &Site) -> AuditReport
Runs every (enabled) gate sequentially and collects the result.
§Examples
use std::path::PathBuf;
use ssg::audit::{AuditConfig, AuditRunner, Site};
let runner = AuditRunner::new(AuditConfig::new());
let site = Site { root: PathBuf::from("/nonexistent"), html_files: Vec::new() };
let report = runner.run(&site);
assert_eq!(report.len(), 15);Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AuditRunner
impl !UnwindSafe for AuditRunner
impl Freeze for AuditRunner
impl Send for AuditRunner
impl Sync for AuditRunner
impl Unpin for AuditRunner
impl UnsafeUnpin for AuditRunner
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
§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