pub struct Renderer { /* private fields */ }Expand description
Builder for loading Criterion results and rendering them as markdown.
Implementations§
Source§impl Renderer
impl Renderer
Sourcepub fn new(criterion_dir: impl AsRef<Path>) -> Self
pub fn new(criterion_dir: impl AsRef<Path>) -> Self
Creates a renderer for a Criterion output directory.
Sourcepub fn candidate(self, candidate: impl AsRef<str>) -> Self
pub fn candidate(self, candidate: impl AsRef<str>) -> Self
Selects the dataset to render. Defaults to new.
Sourcepub fn baseline(self, baseline: impl AsRef<str>) -> Self
pub fn baseline(self, baseline: impl AsRef<str>) -> Self
Selects the baseline used to compute changes.
If not selected, the renderer uses Criterion’s default base dataset
when it exists and otherwise omits comparison information. Rendering
fails if an explicitly selected baseline cannot be found.
Sourcepub fn baseline_root(self, baseline_root: impl AsRef<Path>) -> Self
pub fn baseline_root(self, baseline_root: impl AsRef<Path>) -> Self
Selects the Criterion output root containing the baseline.
Defaults to the candidate’s Criterion output directory.
Sourcepub fn benchmark(self, entry: impl AsRef<str>) -> Self
pub fn benchmark(self, entry: impl AsRef<str>) -> Self
Selects a benchmark by its full id.
If no benchmarks are selected explicitly, all benchmarks are rendered.
Sourcepub fn benchmarks(
self,
entries: impl IntoIterator<Item = impl AsRef<str>>,
) -> Self
pub fn benchmarks( self, entries: impl IntoIterator<Item = impl AsRef<str>>, ) -> Self
Selects benchmarks by their full ids.
Repeated calls are additive. If no benchmarks are selected explicitly, all benchmarks are rendered.
Sourcepub fn title(self, title: impl AsRef<str>) -> Self
pub fn title(self, title: impl AsRef<str>) -> Self
Sets the report title. Defaults to Benchmarks.
Sourcepub fn collapsible(self, collapsible: bool) -> Self
pub fn collapsible(self, collapsible: bool) -> Self
Controls whether the output is wrapped in a <details> element.
Sourcepub fn thresholds(self, thresholds: Thresholds) -> Self
pub fn thresholds(self, thresholds: Thresholds) -> Self
Configures the ratios used to select change indicators.
Sourcepub fn emojis(self, emojis: Emojis) -> Self
pub fn emojis(self, emojis: Emojis) -> Self
Configures the emojis used for benchmark change classifications.
Sourcepub fn summary_limit(self, limit: usize) -> Self
pub fn summary_limit(self, limit: usize) -> Self
Sets the maximum number of improvements and regressions shown in the summary.
Defaults to 3. A limit of 0 omits the summary.