Skip to main content

PreformatReportExt

Trait PreformatReportExt 

Source
pub trait PreformatReportExt {
    // Required method
    fn preformat(&self) -> Report<PreformattedContext, Mutable, SendSync>;
}
Expand description

Extension trait providing preformat on Report, ReportRef, and ReportMut.

§Examples

use rootcause::prelude::*;
use rootcause_preformat::{PreformatReportExt, PreformattedContext};

let report: Report = report!("boom");
let preformatted: Report<PreformattedContext, _, _> = report.preformat();

Required Methods§

Source

fn preformat(&self) -> Report<PreformattedContext, Mutable, SendSync>

Creates a new report, which has the same structure as the current report, but has all the contexts and attachments preformatted.

This can be useful, as the new report is mutable because it was just created, and additionally the new report is Send+Sync.

§Examples
let report_mut: ReportMut<'_, NonSendSyncError, markers::Local> = report.as_mut();
let preformatted: Report<PreformattedContext, markers::Mutable, markers::SendSync> =
    report_mut.preformat();
assert_eq!(format!("{report}"), format!("{preformatted}"));

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, C: ?Sized, O, T> PreformatReportExt for ReportRef<'a, C, O, T>

Source§

impl<'a, C: ?Sized, T> PreformatReportExt for ReportMut<'a, C, T>

Source§

impl<C: ?Sized, O, T> PreformatReportExt for Report<C, O, T>

Implementors§