pub trait PreformatAttachmentExt {
// Required method
fn preformat(&self) -> ReportAttachment<PreformattedAttachment, SendSync>;
}Expand description
Extension trait providing preformat on
ReportAttachment, ReportAttachmentRef, and ReportAttachmentMut.
§Examples
use rootcause::report_attachment::ReportAttachment;
use rootcause_preformat::PreformatAttachmentExt;
let attachment = ReportAttachment::new_sendsync(42i32);
let preformatted = attachment.preformat();
assert_eq!(
attachment.format_inner().to_string(),
preformatted.format_inner().to_string()
);Required Methods§
Sourcefn preformat(&self) -> ReportAttachment<PreformattedAttachment, SendSync>
fn preformat(&self) -> ReportAttachment<PreformattedAttachment, SendSync>
Creates a new attachment, with the inner attachment data preformatted.
This can be useful, as the preformatted attachment is a newly allocated
object and additionally is Send+Sync.
See PreformattedAttachment for more information.
§Examples
use rootcause::report_attachment::ReportAttachment;
use rootcause_preformat::PreformatAttachmentExt;
let attachment = ReportAttachment::new_sendsync(42i32);
let preformatted = attachment.preformat();Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".